getgroups(3P) getgroups(3P)NAME getgroups - get the group access list SYNOPSIS #include <sys/types.h> int getgroups(gidsetlen, gidset) int gidsetlen; gid_t *gidset; DESCRIPTION getgroups gets the current group access list 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 groups returned in gidset. No more than NGROUPS_MAX, as defined in <limits.h>, are ever returned. If gidsetlen is 0, getgroups returns the number of supplementary group IDs associated with the cal- ling process without modifying the array pointed to by gid- set. RETURN VALUE A successful call returns the number of groups in the group set. If an error is detected, -1 is returned and the error code is stored in the global variable errno. ERRORS The possible error values for getgroups are: [EINVAL] The argument gidsetlen is smaller than the number of groups in the group set. [EFAULT] The argument gidset specifies an invalid ad- dress. SEE ALSO setgroups(2), initgroups(3X). March, 1990 1