The
getgrouplist() and
getgroupmembership() functions read through the group database and calculate the group access list for the user specified in
name. The
basegid is automatically included in the groups list. Typically this value is given as the group number from the password database.
The resulting group list is returned in the integer array pointed to by
groups.
For
getgrouplist(), the caller specifies the size of the
groups array in the integer pointed to by
ngroups.
For
getgroupmembership(), the caller specifies the size of the
groups array in
maxgrp.
The actual number of groups found is returned in
ngroups.
Duplicate group ids will be suppressed from the result.