2 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
12 #include <sys/types.h>
13 #include <sys/syscall.h>
15 libc_hidden_proto(setresgid)
16 libc_hidden_proto(setregid)
18 int setegid(gid_t gid)
22 if (gid == (gid_t) ~0)
29 result = setresgid(-1, gid, -1);
30 if (result == -1 && errno == ENOSYS)
31 /* Will also set the saved group ID if egid != gid,
32 * making it impossible to switch back...*/
34 result = setregid(-1, gid);