Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setgid(2) — GL2 W3.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getuid(2)

intro(2)

SETUID(2)  —  Silicon Graphics

NAME

setuid, setgid − set user and group IDs

SYNOPSIS

int setuid (uid)
int uid;

int setgid (gid)
int gid;

DESCRIPTION

Setuid (setgid) is used to set the real user (group) ID and effective user (group) ID of the calling process. 

If the effective user ID of the calling process is super-user, the real user (group) ID and effective user (group) ID are set to uid (gid).

If the effective user ID of the calling process is not super-user, but its real user (group) ID is equal to uid (gid), the effective user (group) ID is set to uid (gid).

Setuid (setgid) will fail if the real user (group) ID of the calling process is not equal to uid (gid) and its effective user ID is not super-user.  ­[EPERM]

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

SEE ALSO

getuid(2), intro(2). 

ASSEMBLER

moveq#23,D0| sys setuid
movluid,A0
trap#0

Carry bit cleared on success.
 moveq#46,D0| sys setgid
movlgid,A0
trap#0

Carry bit set on failure and cleared on success.

Version 3.6  —  December 20, 1987

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