getgroups(2) — System Calls
OSF
NAME
getgroups − Gets the supplementary group set of the current process
SYNOPSIS
#include <unistd.h>
#include <sys/types.h> int getgroups (
int gidsetsize,
gid_t grouplist[] );
PARAMETERS
gidsetsizeIndicates the number of entries that can be stored in the array pointed to by the grouplist parameter.
grouplistPoints to the array in which the process’ supplementary group set of the user process is stored. Element grouplist[0] is the effective group ID of the process.
DESCRIPTION
The getgroups() function gets the supplementary group set of the process. The list is stored in the array pointed to by the grouplist parameter. The gidsetsize parameter indicates the number of entries that can be stored in this array.
The getgroups() function never returns more than NGROUPS_MAX entries. (NGROUPS_MAX is a constant defined in the limits.h header file.) If the gidsetsize parameter is 0 (zero), the getgroups() function returns the number of groups in the supplementary group set.
NOTES
AES Support Level:
Full use
RETURN VALUES
Upon successful completion, the getgroups() function returns the number of elements stored in the array pointed to by the grouplist parameter. If getgroups() fails, then a value of -1 is returned and errno is set to indicate the error.
ERRORS
If the getgroups() function fails, errno may be set to one of the following values:
[EFAULT]The gidsetsize and grouplist parameters specify an array that is partially or completely outside of the allocated address space of the process.
[EINVAL]The gidsetsize parameter is nonzero and smaller than the number of groups in the supplementary group set.
RELATED INFORMATION
Functions: setgroups(2), getgid(2), setsid(2), initgroups(3)
Commands: groups(1)