COHERENT manpages

This page displays the COHERENT manpage for getgroups() [Read the supplemental group-access list].

List of available manpages
Index


getgroups() -- System Call (libc)

Read the supplemental group-access list
#include <unistd.h>
int getgroups(gidsetsize, grouplist)
int gidsetsize; gid_t *grouplist;

The  ``supplemental group-access  list'' is the  list of  group identifiers
that  are  used  in   addition  to  the  effective  group  identifier  when
determining the level of access that  a process has to a file.  getgroups()
reads the identifiers  from the current process's supplemental group-access
list, and writes them into the array to which grouplist points.

grouplist has gidsetsize entries, and must be large enough to contain every
entry from  the list.  The list cannot have  more than NGROUPS_MAX entries.
If  gidsetsize equals  zero, getgroups()  returns the  number of  groups to
which  the calling  process belongs  without modifying  the array  to which
grouplist points.

If  all goes  well, getgroups() returns  the number  of supplementary-group
identifiers  set for  the  calling process.   It  fails and  returns -1  if
gidsetsize is greater than zero  but less than the number of supplementary-
group identifiers set for the calling process, or if grouplist points to an
illegal address.  In  the former instance, it sets errno  to EINVAL; in the
latter, it sets errno to EFAULT.

See Also

libc,
setgroups(),
unistd.h
POSIX Standard, §4.2.3