summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-01 10:55:19 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-01 13:36:43 -0500
commite65ef51dee7a7d3565f471b67f29a257c6128fb3 (patch)
treed9389c9fd5c0de81b9021d49f3d86def77372990 /src/shared
parentaec432c6134146e138124c4130be2ee89dca07fa (diff)
missing: add __NR_renameat2
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/missing.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/shared/missing.h b/src/shared/missing.h
index 94d9d8d35d..5cf179ef00 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -679,6 +679,30 @@ static inline pid_t raw_getpid(void) {
}
#if !HAVE_DECL_RENAMEAT2
+
+#ifndef __NR_renameat2
+# if defined __x86_64__
+# define __NR_renameat2 316
+# elif defined __arm__
+# define __NR_renameat2 382
+# elif defined _MIPS_SIM
+# if _MIPS_SIM == _MIPS_SIM_ABI32
+# define __NR_renameat2 4351
+# endif
+# if _MIPS_SIM == _MIPS_SIM_NABI32
+# define __NR_renameat2 6315
+# endif
+# if _MIPS_SIM == _MIPS_SIM_ABI64
+# define __NR_renameat2 5311
+# endif
+# elif defined __i386__
+# define __NR_renameat2 353
+# else
+# warning "__NR_renameat2 unknown for your architecture"
+# define __NR_renameat2 0xffffffff
+# endif
+#endif
+
static inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags);
}