BSD 3 development
[unix-history] / usr / man / man2 / setuid.2
CommitLineData
e6817382
BJ
1.TH SETUID 2
2.SH NAME
3setuid, setgid \- set user and group ID
4.SH SYNOPSIS
5.B setuid(uid)
6.PP
7.B setgid(gid)
8.SH DESCRIPTION
9The user ID (group ID) of the current process is set to
10the argument.
11Both the effective and the real ID are set.
12These calls are only permitted to the super-user
13or if the argument is the real ID.
14.SH "SEE ALSO"
15getuid(2)
16.SH DIAGNOSTICS
17Zero is returned if the user (group) ID is set;
18\-1 is returned otherwise.
19.SH "ASSEMBLER (PDP-11)"
20(setuid = 23.)
21.br
22(user ID in r0)
23.br
24.B sys setuid
25.PP
26(setgid = 46.)
27.br
28(group ID in r0)
29.br
30.B sys setgid