about summary refs log tree commit diff
path: root/src/unistd/setuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/setuid.c')
-rw-r--r--src/unistd/setuid.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/unistd/setuid.c b/src/unistd/setuid.c
new file mode 100644
index 00000000..53b74d88
--- /dev/null
+++ b/src/unistd/setuid.c
@@ -0,0 +1,9 @@
+#include <unistd.h>
+#include "syscall.h"
+#include "libc.h"
+
+int setuid(uid_t uid)
+{
+	if (libc.rsyscall) return libc.rsyscall(__NR_setuid32, uid, 0, 0, 0, 0, 0);
+	return syscall1(__NR_setuid32, uid);
+}