DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

setgroups(S-osr5)


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-osr5), initgroups(S-osr5), setluid(S-osr5), sysconf(S-osr5), usersgroups(S-osr5),

Standards conformance

The setgroups routine is an extension of AT&T System V provided by the Santa Cruz Operation.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005