getgroups()

get supplementary group IDs 

Function


SYNOPSIS

#include <sys/types.h>

#include <unistd.h>

int getgroups(int gidsetsize, gid_t *grouplist);


DESCRIPTION

The getgroups() function fills in the specified array with the current supplementary group IDs of the calling process.


PARAMETERS

gidsetsize 

Specifies the number of elements in the supplied array grouplist. If gidsetsize is zero, getgroups() returns the number of supplementary group IDs associated with the calling process without modifying the array that the grouplist parameter points to.

grouplist 

Is the array where getgroups() supplies the supplementary group IDs of the calling process. It returns the actual number of supplementary group IDs stored in the array.


RETURN VALUES

If successful, getgroups() returns the number of supplementary group IDs written to grouplist if gidsetsize is greater than 0, or the number of supplementary group IDs for the process if gidsetsize is 0. On failure, getgroups() returns -1 and sets errno to one of the following values:

EINVAL 

gidsetsize is not equal to zero and is less than the number of supplementary group IDs.


CONFORMANCE

POSIX.1 (1996), with exceptions.


MULTITHREAD SAFETY LEVEL

Async-signal-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
getgid(), setgid()


PTC MKS Toolkit 10.3 Documentation Build 39.