branch for updated copyright for network release
[unix-history] / usr / src / lib / libc / sys / setuid.2
CommitLineData
1d70186a
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
80d6e3f5 5.\" @(#)setuid.2 6.3 (Berkeley) %G%
1d70186a 6.\"
2b413789 7.TH SETUID 3 ""
1d70186a
KM
8.UC 5
9.SH NAME
10setuid, seteuid, setruid, setgid, setegid, setrgid \- set user and group ID
11.SH SYNOPSIS
12.nf
f8eedcbc
KM
13.ft B
14#include <sys/types.h>
1d70186a 15.PP
f8eedcbc
KM
16.ft B
17.nf
18setuid(uid)
19seteuid(euid)
20setruid(ruid)
21uid_t uid, euid, ruid;
22.PP
23.ft B
24.nf
25setgid(gid)
26setegid(egid)
27setrgid(rgid)
28gid_t gid, egid, rgid;
1d70186a
KM
29.fi
30.SH DESCRIPTION
31.I Setuid
32.RI ( setgid )
33sets both the real and effective
34user ID (group ID) of the current process to
35as specified.
36.PP
37.I Seteuid
38.RI ( setegid )
39sets the effective user ID (group ID) of the
40current process.
41.PP
42.I Setruid
80d6e3f5 43.RI ( setrgid )
1d70186a
KM
44sets the real user ID (group ID) of the
45current process.
46.PP
47These calls are only permitted to the super-user
48or if the argument is the real or effective ID.
49.SH "SEE ALSO"
50setreuid(2), setregid(2), getuid(2), getgid(2)
51.SH DIAGNOSTICS
52Zero is returned if the user (group) ID is set;
53\-1 is returned otherwise.