BSD syscall#243
svc · unix #243
initgroups
Initialises the supplementary group list from the user database.
Prototype
int initgroups(u_int gidsetsize, gid_t *gidset, int gmuid);Returns: int
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| gidsetsize | u_int | - | |
| gidset | gid_t | - | |
| gmuid | int | - |
Version history
| XNU tag | macOS | # |
|---|---|---|
| xnu-1456.1.26 | macOS 10.6 Snow Leopard | 243 |
| xnu-1486.2.11 | — | 243 |
| xnu-1504.15.3 | — | 243 |
| xnu-1504.3.12 | — | 243 |
| xnu-1504.7.4 | — | 243 |
| xnu-1504.9.17 | — | 243 |
| xnu-1504.9.26 | — | 243 |
| xnu-1504.9.37 | — | 243 |
Notes
Libc helper that queries Open Directory for every group the named user belongs to and then calls setgroups(). On macOS, this query may hit the local DS, Active Directory, or other plugins, so it can block on network I/O. Like setgroups(), it requires effective root.
Related APIs
setgroupsgetgroupssetuidsetgidgetlogin