SETGROUPS(S) UNIX System V SETGROUPS(S)
Name
setgroups - set group access list
Syntax
#include <sys/param.h>
setgroups(ngroups, gidset)
int gidsetsize;
gid_t *grouplist;
Description
setgroups sets the group access list of the current user
process according to the array gidset. The parameter
gidsetsize indicates the number of entries in the array and
must be no larger than the current value of NGROUPS.
NGROUPS is a tunable kernel parameter.
Only the super-user may set new groups.
Return Value
A 0 value is returned on success, -1 on error, with a error
code stored in errno.
Diagnostics
The setgroups call will fail if:
[EPERM] The caller is not the super-user.
[EFAULT] The address specified for gidset is outside
the process address space.
[EINVAL] The gidsetsize parameter is less than zero or
greater than NGROUPS.
See Also
getgroups(S)
(printed 6/20/89)