BSD 4_2 development
[unix-history] / usr / man / man3 / setuid.3
.TH SETUID 3 "1 April 1983"
.UC 4
.SH NAME
setuid, seteuid, setruid, setgid, setegid, setrgid \- set user and group ID
.SH SYNOPSIS
.nf
.B setuid(uid)
.B seteuid(euid)
.B setruid(ruid)
.PP
.B setgid(gid)
.B setegid(egid)
.B setrgid(rgid)
.fi
.SH DESCRIPTION
.I Setuid
.RI ( setgid )
sets both the real and effective
user ID (group ID) of the current process to
as specified.
.PP
.I Seteuid
.RI ( setegid )
sets the effective user ID (group ID) of the
current process.
.PP
.I Setruid
.RI ( setruid )
sets the real user ID (group ID) of the
current process.
.PP
These calls are only permitted to the super-user
or if the argument is the real or effective ID.
.SH "SEE ALSO"
setreuid(2), setregid(2), getuid(2), getgid(2)
.SH DIAGNOSTICS
Zero is returned if the user (group) ID is set;
\-1 is returned otherwise.