GETGROUPS(2,L) AIX Technical Reference GETGROUPS(2,L)
-------------------------------------------------------------------------------
getgroups
PURPOSE
Gets the group access list.
SYNTAX
#include <grp.h>
int getgroups (ngroups, gidset)
int ngroups, *gidset;
DESCRIPTION
The getgroups system call gets the current group access list of the user
process. The list is stored in the array pointed to by the gidset parameter.
The ngroups parameter indicates the number of entries that can be stored in
this array. getgroups never returns more than NGROUPS entries. (NGROUPS is a
constant defined in the grp.h header file.)
As a special case, if the ngroups parameter is 0, the number of entries in the
group access list of the user process is returned. The array pointed to by the
gidset parameter is not modified.
RETURN VALUE
Upon successful completion, the getgroups system call returns the number of
elements stored into the array pointed to by the gidset parameter. If
getgroups fails, then a value of -1 is returned and errno is set to indicate
the error.
ERROR CONDITIONS
The getgroups system call fails if the following is true:
EFAULT The ngroups and gidset parameters specify an array that is partially or
completely outside of the process's allocated address space.
EINVAL The argument, ngroups, is smaller than the number of entries in the
current group access list.
RELATED INFORMATION
In this book: "initgroups" and "setgroups."
Processed November 7, 1990 GETGROUPS(2,L) 1