Implementation status: to be implemented
int getgroups(int gidsetsize, gid_t grouplist);
getgroups() function gets supplementary group IDs.
gidsetsize - the number of elements in the array grouplist,
grouplist - the array with the current supplementary group IDs of the calling process.
getgroups() function fills in the array grouplist with the current supplementary group IDs of the calling process. The
getgroups() function also returns the effective group ID in the grouplist array.
The gidsetsize argument specifies the number of elements in the array grouplist. The actual number of group IDs stored in the array is returned. The values of array entries with indices greater than or equal to the value returned are undefined.
If gidsetsize is
getgroups() returns the number of group IDs that it would otherwise return without modifying the array pointed to by grouplist.
If the effective group ID of the process is returned with the supplementary group IDs, the value returned is always greater than or equal to one and less than or equal to the value of
The number of supplementary group IDs is returned on success. On error
-1 is returned and
errno is set to indicate the error.
EINVAL] The gidsetsize argument is non-zero and less than the number of group IDs that would have been returned.
- Implement the