Commit | Line | Data |
---|---|---|
96750fe6 KM |
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 | .\" | |
770a91db | 5 | .\" @(#)setreuid.2 6.2 (Berkeley) %G% |
96750fe6 | 6 | .\" |
5abf252e | 7 | .TH SETREUID 2 "" |
96750fe6 KM |
8 | .UC 4 |
9 | .SH NAME | |
085d7c51 | 10 | setreuid \- set real and effective user ID's |
96750fe6 | 11 | .SH SYNOPSIS |
085d7c51 KM |
12 | .ft B |
13 | .nf | |
14 | setreuid(ruid, euid) | |
15 | int ruid, euid; | |
16 | .fi | |
17 | .ft R | |
96750fe6 | 18 | .SH DESCRIPTION |
085d7c51 KM |
19 | The real and effective user ID's of the |
20 | current process are set according to the arguments. | |
21 | If | |
22 | .I ruid | |
23 | or | |
24 | .I euid | |
25 | is \-1, the current uid is filled in by the system. | |
5abf252e KM |
26 | Unprivileged users may change the real user |
27 | ID to the effective user ID and vice-versa; only the super-user may | |
28 | make other changes. | |
085d7c51 KM |
29 | .SH "RETURN VALUE |
30 | Upon successful completion, a value of 0 is returned. Otherwise, | |
31 | a value of \-1 is returned and \fIerrno\fP is set to indicate the error. | |
32 | .SH "ERRORS | |
33 | .TP 15 | |
34 | [EPERM] | |
35 | The current process is not the super-user and a change | |
36 | other than changing the effective user-id to the real user-id | |
37 | was specified. | |
96750fe6 | 38 | .SH "SEE ALSO" |
085d7c51 | 39 | getuid(2), setregid(2), setuid(3) |