setgroups

Name

setgroups -- set list of supplementary group IDs

Synopsis

#include <grp.h>

int setgroups(size_t size, const gid_t * list);

Description

If the process has appropriate privilege, the setgroups() function shall set the supplementary group IDs for the current process. list shall reference an array of size group IDs. A process may have at most NGROUPS_MAX supplementary group IDs.

Return Value

On successful completion, 0 is returned. On error, -1 is returned and the errno is set to indicate the error.

Errors

EFAULT 

list has an invalid address.

EPERM 

The process does not have appropriate privileges.

EINVAL 

size is greater than NGROUPS_MAX.