[Previous] [Contents] [Next]

setgroups()

Set supplementary group IDs

Synopsis:

#include <unistd.h>

int setgroups( int ngroups,
               const gid_t *gidset );

Library:

libc

Description:

The setgroups() function sets the group access list of the current user to the array of group IDs in gidset. There will be at least ngroups group IDs in gidset, and must be less than or equal to NGROUPS_MAX.

Only root can set new groups.

Returns:

0, or -1 if an error occurred (errno is set).

Errors:

EFAULT
The gidset argument isn't a valid pointer.
EPERM
The caller isn't root.

Classification:

Unix

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread No

See also:

getgroups(), initgroups()


[Previous] [Contents] [Next]