Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getgroups(2)

setgroups(2)

setregid(2)

setgroups(1)

setrgid(3)  —  Subroutines

OSF

NAME

setrgid, setegid − Sets the process group IDs

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

#include <sys/types.h> int setrgid (
gid_t rgid ); int setegid (
gid_t egid );

PARAMETERS

rgidSpecifies the value of the real group ID to be set. 

egidSpecifies the value of the effective group ID to be set. 

DESCRIPTION

The setegid() function sets the process’ effective group ID to the value of the egid parameter if the egid parameter is equal to the current real, effective, or saved group ID. 

The setrgid() function sets the process’ real group ID to the value of the rgid parameter. 

Only the superuser may change the real or effective group ID to a value other than the current real or saved group ID of the process. 

RETURN VALUES

Upon successful completion, the setegid() and setrgid() functions return a value of 0 (zero).  If the either function fails, a value of -1 is returned and errno is set to indicate the error. 

ERRORS

If the setrgid() or setegid() function fails, errno may be set to one of the following values:

[EPERM]The rgid or egid parameter is not equal to either the real or saved group IDs of the process and the calling process does not have superuser privilege. 

RELATED INFORMATION

Functions: getgroups(2), setgroups(2), setregid(2)

Commands: setgroups(1)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026