Go to the previous, next section.

setgid

SYNOPSIS

int setgid(gid_t gid);

PARAMETERS

gid: [in] the new gid.

DESCRIPTION

If the calling task does not have superuser privileges, it may use setgid to sets its effective gid to its saved gid or its real gid (other values are illegal). If the calling task has superuser privileges, the real, effective and saved gids are set to gid.

RETURN VALUE

On success, returns 0. On error, returns -1 and errno is set to one of the following values: EPERM: the gid is not the real gid or the saved gid of the task and the task does not have superuser privileges.

Go to the previous, next section.