Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

setgroups - write group numbers

&pagelevel(4)&pagelevel

Syntax

#include <unistd.h>

int setgroups(int ngroups, const gid_t grouplist[]); 

Description

The setgroups() function can only be called by the system administrator. The setgroups() function sets the group access list of the calling process from the group numbers field. The number of entries is specified by the ngroups parameter and must not exceed NGROUPS_MAX.

Return val.

0

-1

if successful.

if unsuccessful. errno indicates the cause of the error.

Errors

setgroups() will fail if:

EINVAL

The value ngroups exceeds NGROUPS_MAX.

EFAULT

A referenced part of the grouplist array is outside the address range assigned to the process.

EPERM

The effective user number is not the user number of the system administrator.