1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)setreuid.2 6.1 (Berkeley) 5/9/85
7 .TH SETUID 2 "May 9, 1985"
10 setuid, seteuid, setgid, setegid \- set (effective) user or group ID's
14 #include <sys/types.h>
16 int setuid(uid_t \fIuid\fP)
17 int seteuid(uid_t \fIeuid\fP)
18 int setgid(gid_t \fIgid\fP)
19 int setegid(gid_t \fIegid\fP)
24 sets the real and effective user ID's of the
27 Unprivileged users may only change both user ID's
28 to the real user ID; only the super-user may
31 does the same for the real and effective group ID's.
34 allows an unprivileged user to change ID's to the original real or effective
35 ID as they were at the time the process was executed.
37 may also set the group ID's to any of the additional group ID's.
39 remembered user ID's was 0 then any user or group ID may be chosen.
41 Upon successful completion, a value of 0 is returned. Otherwise,
42 a value of \-1 is returned and \fBerrno\fP is set to indicate the error.
46 The current process is not the super-user and a change
47 other than one of the allowed changes was attempted.