source: trunk/minix/man/man2/setuid.2@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 1.4 KB
Line 
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.
4.\"
5.\" @(#)setreuid.2 6.1 (Berkeley) 5/9/85
6.\"
7.TH SETUID 2 "May 9, 1985"
8.UC 4
9.SH NAME
10setuid, seteuid, setgid, setegid \- set (effective) user or group ID's
11.SH SYNOPSIS
12.nf
13.ft B
14#include <sys/types.h>
15
16int setuid(uid_t \fIuid\fP)
17int seteuid(uid_t \fIeuid\fP)
18int setgid(gid_t \fIgid\fP)
19int setegid(gid_t \fIegid\fP)
20.ft R
21.fi
22.SH DESCRIPTION
23.B Setuid
24sets the real and effective user ID's of the
25current process to
26.IR uid .
27Unprivileged users may only change both user ID's
28to the real user ID; only the super-user may
29make other changes.
30.B Setgid
31does the same for the real and effective group ID's.
32.PP
33Minix-vmd
34allows an unprivileged user to change ID's to the original real or effective
35ID as they were at the time the process was executed.
36.B Setgid
37may also set the group ID's to any of the additional group ID's.
38If one of the
39remembered user ID's was 0 then any user or group ID may be chosen.
40.SH "RETURN VALUE
41Upon successful completion, a value of 0 is returned. Otherwise,
42a value of \-1 is returned and \fBerrno\fP is set to indicate the error.
43.SH "ERRORS
44.TP 15
45[EPERM]
46The current process is not the super-user and a change
47other than one of the allowed changes was attempted.
48.SH "SEE ALSO"
49.BR getuid (2),
50.BR geteuid (2),
51.BR getgid (2).
52.BR getegid (2).
Note: See TracBrowser for help on using the repository browser.