Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setuid(3V) — SunOS 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

execve(2)

getgid(2)

getuid(2)

setregid(2)

setreuid(2)

SETUID(3V)  —  SYSTEM V LIBRARY

NAME

setuid, setgid − set user and group IDs

SYNOPSIS

setuid(uid)
setgid(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).

If the effective user (group) ID of the calling process is not super-user, but the saved set-user (group) ID from execve(2) is equal to uid (gid), the effective user (group) ID is set to uid (gid).

SEE ALSO

execve(2), getgid(2), getuid(2), setregid(2), setreuid(2),

DIAGNOSTICS

Zero is returned if the user (group) ID is set; −1 is returned otherwise, with the global variable errno set as for setreuid() (setregid). 

Sun Release 4.0  —  Last change: 22 November 1987

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