int getgroups(gidsetlen, gidset) int gidsetlen; int gidset[];
int setgroups(ngroups, gidset) int ngroups; int gidset[];
#include <sys/types.h>
int getgroups(gidsetlen, gidset) int gidsetlen; gid_t gidset[];
int setgroups(ngroups, gidset) int ngroups; gid_t gidset[];
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.
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:
Either call fails if:
getgroups() fails if:
setgroups() fails if:
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97