setgroups
Purpose
Sets the group access list.
Syntax
#include <grp.h>
int setgroups (ngroups, gidset);
int ngroups, *gidset;
Description
The setgroups system call sets the group access list of
the current user process according to the array pointed
to by the gidset parameter. The ngroups parameter indi-
cates the number of entries in the array and must not be
more than NGROUPS, as defined in the grp.h header file.
Only a process with an effective user ID of superuser can
set new groups.
Return Value
Upon successful completion, a value of 0 is returned. If
the setgroups system call fails, a value of -1 is
returned and errno is set to indicate the error.
Diagnostics
The setgroups system call fails if one or more of the
following is true:
EPERM The caller is not superuser.
EINVAL The value of the ngroups parameter is greater
than NGROUPS.
EFAULT The gidset parameter &pointsout..
Related Information
In this book: "getgroups" and "initgroups."