summaryrefslogtreecommitdiff
path: root/src/unistd
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-03 16:20:57 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-03 16:20:57 -0400
commit1db283bf19c3e2a41345895b887a88aea086cb29 (patch)
tree1483efd8d5469c2985795d6c6db132e1a1d9e9be /src/unistd
parent7fd3995282db788e33f1bfd7eea95b480d45c804 (diff)
downloadmusl-1db283bf19c3e2a41345895b887a88aea086cb29.tar.gz
add setresuid/setresgid functions (nonstandard)
Diffstat (limited to 'src/unistd')
-rw-r--r--src/unistd/setresgid.c10
-rw-r--r--src/unistd/setresuid.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/unistd/setresgid.c b/src/unistd/setresgid.c
new file mode 100644
index 00000000..3c85a828
--- /dev/null
+++ b/src/unistd/setresgid.c
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include "syscall.h"
+#include "libc.h"
+
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
+{
+ if (libc.rsyscall) return libc.rsyscall(__NR_setresgid, rgid, egid, sgid, 0, 0, 0);
+ return syscall(SYS_setresgid, rgid, egid, sgid);
+}
diff --git a/src/unistd/setresuid.c b/src/unistd/setresuid.c
new file mode 100644
index 00000000..376ce406
--- /dev/null
+++ b/src/unistd/setresuid.c
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include "syscall.h"
+#include "libc.h"
+
+int setresuid(uid_t ruid, uid_t euid, uid_t suid)
+{
+ if (libc.rsyscall) return libc.rsyscall(__NR_setresuid, ruid, euid, suid, 0, 0, 0);
+ return syscall(SYS_setresuid, ruid, euid, suid);
+}