summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/setregid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/setregid.c')
-rw-r--r--libc/sysdeps/linux/common/setregid.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/setregid.c b/libc/sysdeps/linux/common/setregid.c
index a085ed2ab..b37a888e9 100644
--- a/libc/sysdeps/linux/common/setregid.c
+++ b/libc/sysdeps/linux/common/setregid.c
@@ -9,10 +9,21 @@
#include "syscalls.h"
#include <unistd.h>
+#include <bits/wordsize.h>
libc_hidden_proto(setregid)
-#define __NR___syscall_setregid __NR_setregid
+#if (__WORDSIZE == 32 && defined(__NR_setregid32)) || __WORDSIZE == 64
+# ifdef __NR_setregid32
+# undef __NR_setregid
+# define __NR_setregid __NR_setregid32
+# endif
+
+_syscall2(int, setregid, gid_t, rgid, gid_t, egid);
+
+#else
+
+# define __NR___syscall_setregid __NR_setregid
static inline _syscall2(int, __syscall_setregid,
__kernel_gid_t, rgid, __kernel_gid_t, egid);
@@ -25,4 +36,6 @@ int setregid(gid_t rgid, gid_t egid)
}
return (__syscall_setregid(rgid, egid));
}
+#endif
+
libc_hidden_def(setregid)