manual page first distributed with 4.2BSD
[unix-history] / usr / src / lib / libc / sys / setuid.2
.\" Copyright (c) 1983 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" @(#)setuid.2 5.1 (Berkeley) %G%
.\"
.TH SETUID 3 "1 April 1983"
.UC 5
.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.