getgroups [ MPE/iX Developer's Kit Reference Manual Volume I ] MPE/iX 5.0 Documentation
MPE/iX Developer's Kit Reference Manual Volume I
getgroups
Gets Supplementary Group IDs.
Syntax
#include <sys/types.h>
int getgroups (int *gidsetsize, gid_t grouplist[]);
Parameters
gidsetsize The number of elements in the grouplist array.
grouplist An array containing the supplementary group IDs of the calling
process.
Return Values
Upon successful completion, the number of supplementary group IDs is
returned. This value is zero if {NGROUPS_MAX} is zero. A return value
of -1 indicates failure, and errno is set to indicate the error.
Description
The getgroups() function fills in the array grouplist with the
supplementary group IDs of the calling process. The gidsetsize argument
specifies the number of elements in the supplied grouplist array. The
actual number of suplementary group IDs stored in the array is returned.
The values of array entries with indices larger than or equal to the
returned value are undefined.
As a special case, if the gidsetsize argument is zero, getgroups()
returns the number of supplemental group IDs associated with the calling
process without modifying the array pointed to by the grouplist argument.
Implementation Considerations
Supplemental group IDs are not currently supported ({NGROUPS_MAX} is 0).
Therefore, this function will always return 0.
Errors
If an error occurs, errno is set to one of the following values:
EINVAL CAUSE gidsetsize is not equal to zero and is less than the
number of supplemental group IDs.
ACTION Specify a valid and supported value.
See Also
getgid(), POSIX.1
MPE/iX 5.0 Documentation