summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/setreuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/setreuid.c')
-rw-r--r--libc/sysdeps/linux/common/setreuid.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/setreuid.c b/libc/sysdeps/linux/common/setreuid.c
index dcbe4adfe..acff36047 100644
--- a/libc/sysdeps/linux/common/setreuid.c
+++ b/libc/sysdeps/linux/common/setreuid.c
@@ -9,10 +9,21 @@
#include "syscalls.h"
#include <unistd.h>
+#include <bits/wordsize.h>
libc_hidden_proto(setreuid)
-#define __NR___syscall_setreuid __NR_setreuid
+#if (__WORDSIZE == 32 && defined(__NR_setreuid32)) || __WORDSIZE == 64
+# ifdef __NR_setreuid32
+# undef __NR_setreuid
+# define __NR_setreuid __NR_setreuid32
+# endif
+
+_syscall2(int, setreuid, uid_t, ruid, uid_t, euid);
+
+#else
+
+# define __NR___syscall_setreuid __NR_setreuid
static inline _syscall2(int, __syscall_setreuid,
__kernel_uid_t, ruid, __kernel_uid_t, euid);
@@ -25,4 +36,6 @@ int setreuid(uid_t ruid, uid_t euid)
}
return (__syscall_setreuid(ruid, euid));
}
+#endif
+
libc_hidden_def(setreuid)