getgroups(2)
NAME
getgroups − get group access list
SYNOPSIS
#include <sys/types.h>
#include <sys/param.h>
int getgroups (gsize, gidset)
int gsize;
gid_t ∗gidset;
DESCRIPTION
getgroups gets the current group access list of the user process and stores it in the array gidset. The parameter gsize indicates the number of entries which may be placed in gidset . The return value is the number of entries in gidset that were filled. No more than NGROUPS, as defined in <sys/param.h>, will ever be returned. If gsize is zero, the return value is the number of supplemental group IDs associated with the calling process. gidset is not modified.
RETURN VALUE
A value of −1 indicates that an error occurred, and the error code is stored in the global variable errno.
ERRORS
The possible errors for getgroups are:
[EFAULT] The argument gidset is an invalid addresses.
[EINVAL] The size of gidset as specified by gsize is too small to accommodate the entire group access list.
SEE ALSO
CX/UX Programmer’s Reference Manual