Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

getgid(2)

setuid(2)

setgid(2)  —  System Calls

OSF

NAME

setgid − Sets the group ID

SYNOPSIS

#include <sys/types.h> int setgid (
gid_t gid );

PARAMETERS

gidSpecifies the new group ID. 

DESCRIPTION

The setgid() function sets the real group ID, effective group ID, and the saved set group ID to the value specified by the gid parameter. 

If the process does not have superuser privilege, but the gid parameter is equal to the real group ID or the saved set group ID, the setgid() function sets the effective group ID to gid; the real group ID and saved set group ID remain unchanged. 

Any supplementary group IDs of the calling process remain unchanged. 

NOTES

AES Support Level:
Full use

RETURN VALUES

Upon successful completion, the setgid() function returns 0 (zero).  Otherwise, −1 is returned and errno is set to indicate the error.

ERRORS

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

[EINVAL]The value of the gid parameter is invalid. 

[EPERM]The process does not have superuser privilege and the gid parameter does not match the real group ID or the saved set group ID. 

RELATED INFORMATION

Functions: exec(2), getgid(2), setuid(2)

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