add setresuid/setresgid functions (nonstandard)
[musl] / src / unistd / setresgid.c
diff --git a/src/unistd/setresgid.c b/src/unistd/setresgid.c
new file mode 100644 (file)
index 0000000..3c85a82
--- /dev/null
@@ -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);
+}