setgroups(S)
setgroups --
set supplementary group ID's
Syntax
cc . . . -lc
#include <sys/types.h>
int setgroups(gidsetsize, grouplist)
int gidsetsize;
gid_t *grouplist;
Description
The
setgroups
routine sets the supplementary group access list of the calling
process according to the array argument grouplist.
The argument gidsetsize indicates the number of entries
in the array and must be no larger than the current value of
the constant NGROUPS.
NGROUPS is a tunable kernel parameter.
Only the super user may set supplemental group ID's.
Return values
Upon successful completion,
setgroups returns
a value of 0. Otherwise,
setgroups returns
a value of -1 and errno is set to indicate
the appropriate error.
Diagnostics
If one of the following conditions occurs,
setgroups fails and
errno
is set to the corresponding value:
[EFAULT]-
The address specified for grouplist is outside the process
address space.
[EINVAL]-
The gidsetsize parameter is less than zero or greater than
NGROUPS.
[EINVAL]-
An element of grouplist is out of range.
[EPERM]-
The caller is not the super user.
[EPERM]-
The login UID has not yet been set for the calling process.
See also
getgroups(S),
initgroups(S),
setluid(S),
sysconf(S),
usersgroups(S),
Standards conformance
The setgroups routine
is an extension of
AT&T System V
provided by the
Santa Cruz Operation.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003