GETGROUPS(2)

NAME
getgroups - get group access list

SYNOPSIS
#include <sys/param.h>

ngrps = getgroups(gsize, gidset)
int ngrps, gsize, *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.

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 address.

[EINVAL]
    The size of gidset as specified by gsize is too small to accommodate the entire group access list.

SEE ALSO
setgroups(2), initgroups(3)