Index of Section 2 Manual Pages
| Interix / SUA | getgroups.2 | Interix / SUA |
getgroups(2) getgroups(2)
getgroups()
NAME
getgroups() - retrieve supplementary group ID list
SYNOPSIS
#include
#include
int getgroups (int gidsetsize, gid_t grouplist[])
DESCRIPTION
The getgroups(2) function reads through the group database and fills the
grouplist array with the supplementary group IDs of the calling process.
The argument gidsetsize specifies the number of elements in the supplied
array, which cannot be larger than NGROUPS_MAX.
If gidsetsize is set to 0, the return value is the number of supplemental
group IDs associated with the calling process, and the grouplist array is
not modified.
On Windows, groups and users share the same name space in the user
accounts database.
RETURN VALUES
The getgroups(2) function returns the number of supplementary group IDs
filled in the grouplist array. On error, it returns -1.
ERRORS
The getgroups(2) function fails because:
[EINVAL]
The gidsetsize argument isn't equal to 0 and is less than the number
of supplementary group IDs.
SEE ALSO
getgrnam(2)
getpwnam(2)
USAGE NOTES
The getgroups function is thread safe.
The getgroups function is async-signal safe.