1SETREUID(2)                   System Calls Manual                  SETREUID(2)
2
3
4

NAME

6       setreuid - set real and effective user ID's
7

SYNOPSIS

9       #include <unistd.h>
10
11       int
12       setreuid(ruid, euid)
13           uid_t ruid, euid
14

DESCRIPTION

16       The  real and effective user IDs of the current process are set accord‐
17       ing to the arguments.  If ruid or euid is -1, the current uid is filled
18       in  by  the  system.  Unprivileged users may change the real user ID to
19       the effective user ID and vice-versa;  only  the  super-user  may  make
20       other changes.
21
22       The setreuid function has been used to swap the real and effective user
23       IDs in set-user-ID programs to temporarily relinquish  the  set-user-ID
24       value.   This  purpose  is  now better served by the use of the seteuid
25       function (see setuid(2)).
26
27       When setting the real and effective user IDs to  the  same  value,  the
28       standard setuid function is preferred.
29

RETURN VALUES

31       Upon  successful  completion,  a  value of 0 is returned.  Otherwise, a
32       value of -1 is returned and errno is set to indicate the error.
33

ERRORS

35       EPERM     The current process is not the super-user and a change  other
36                 than  changing  the effective user-id to the real user-id was
37                 specified.
38

SEE ALSO

40       getuid(2), seteuid(2), setuid(2)
41

HISTORY

43       The setreuid function call  appeared  in  4.2BSD  and  was  dropped  in
44       4.4BSD.
45
46
47
484th Berkeley Distribution      December 3, 1997                    SETREUID(2)
Impressum