up | Inhaltsverzeichniss | Kommentar

Manual page for GETGROUPS(2V)

getgroups, setgroups - get or set supplementary group IDs

SYNOPSIS

int getgroups(gidsetlen, gidset)
int gidsetlen;
int gidset[];

int setgroups(ngroups, gidset)
int ngroups;
int gidset[];

SYSTEM V SYNOPSIS

#include <sys/types.h>

int getgroups(gidsetlen, gidset)
int gidsetlen;
gid_t gidset[];

int setgroups(ngroups, gidset)
int ngroups;
gid_t gidset[];

DESCRIPTION

getgroups() gets the current supplementary group IDs of the user process and stores it in the array gidset. The parameter gidsetlen indicates the number of entries that may be placed in gidset. getgroups() returns the actual number of entries placed in the gidset array. No more than {NGROUPS_MAX} (see sysconf.2v will ever be returned. If gidsetlen is 0, getgroups() returns the number of groups without modifying the gidset array.

setgroups() sets the supplementary group IDs of the current user process according to the array gidset. The parameter ngroups indicates the number of entries in the array and must be no more than {NGROUPS_MAX} (see sysconf.2v

Only the super-user may set new groups.

RETURN VALUES

On success, getgroups() returns the number of entries placed in the array pointed to by gidset. On failure, it returns -1 and sets errno to indicate the error.

setgroups() returns:

0
on success.
-1
on failure and sets errno to indicate the error.

ERRORS

Either call fails if:

EFAULT
The address specified for gidset is outside the process address space.

getgroups() fails if:

EINVAL
The argument gidsetlen is smaller than the number of groups in the group set.

setgroups() fails if:

EPERM
The caller is not the super-user.

SEE ALSO

initgroups.3


index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97