summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/setregid.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-09-28 20:41:28 +0000
committerMike Frysinger <vapier@gentoo.org>2006-09-28 20:41:28 +0000
commit8006438996ba503957507974948c7673384b777c (patch)
treea1a2b6468f1d74f3ee8153dd002f976ad60c7e0c /libc/sysdeps/linux/common/setregid.c
parent0a24932ab1ffc0ba5fc20f1c7f47b2620b22d080 (diff)
implement support for the rest of the 32bit uid syscalls
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)