summaryrefslogtreecommitdiff
path: root/src/unistd/renameat.c
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
committerVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
commit4abab5ad6c8465a7528ccdd5f49367da05f78bbd (patch)
treeebf009bf1376a5a223a915bc27cbbd791a1316bc /src/unistd/renameat.c
Initial version
Diffstat (limited to 'src/unistd/renameat.c')
-rw-r--r--src/unistd/renameat.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unistd/renameat.c b/src/unistd/renameat.c
new file mode 100644
index 0000000..c3b40a2
--- /dev/null
+++ b/src/unistd/renameat.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include "syscall.h"
+
+int renameat(int oldfd, const char *old, int newfd, const char *new)
+{
+#ifdef SYS_renameat
+ return syscall(SYS_renameat, oldfd, old, newfd, new);
+#else
+ return syscall(SYS_renameat2, oldfd, old, newfd, new, 0);
+#endif
+}