Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS® UNIX | both |
#define _OPEN_SYS
#include <sys/types.h>
#include <grp.h>
int initgroups(const char *user, const gid_t basegid);
The initgroups() function obtains the supplementary group membership of user, and sets the current process supplementary group IDs to that list. The basegid is also included in the supplementary group IDs list.
The caller of this function must be a superuser or must specify the password of the target user name specified on the initgroups() call - issue the passwd() function before initgroups().
If successful, initgroups() returns 0.