1explain_setresuid_or_die(3)Library Functions Manualexplain_setresuid_or_die(3)
2
3
4
6 explain_setresuid_or_die - set r/e/s user ID and report errors
7
9 #include <libexplain/setresuid.h>
10 void explain_setresuid_or_die(uid_t ruid, uid_t euid, uid_t suid);
11 int explain_setresuid_on_error(uid_t ruid, uid_t euid, uid_t suid);
12
14 The explain_setresuid_or_die function is used to call the setresuid(2)
15 system call. On failure an explanation will be printed to stderr,
16 obtained from the explain_setresuid(3) function, and then the process
17 terminates by calling exit(EXIT_FAILURE).
18
19 The explain_setresuid_on_error function is used to call the setre‐
20 suid(2) system call. On failure an explanation will be printed to
21 stderr, obtained from the explain_setresuid(3) function, but still
22 returns to the caller.
23
24 ruid The ruid, exactly as to be passed to the setresuid(2) system
25 call.
26
27 euid The euid, exactly as to be passed to the setresuid(2) system
28 call.
29
30 suid The suid, exactly as to be passed to the setresuid(2) system
31 call.
32
34 The explain_setresuid_or_die function only returns on success, see
35 setresuid(2) for more information. On failure, prints an explanation
36 and exits, it does not return.
37
38 The explain_setresuid_on_error function always returns the value return
39 by the wrapped setresuid(2) system call.
40
42 The explain_setresuid_or_die function is intended to be used in a fash‐
43 ion similar to the following example:
44 explain_setresuid_or_die(ruid, euid, suid);
45
47 setresuid(2)
48 set real, effective and saved user ID
49
50 explain_setresuid(3)
51 explain setresuid(2) errors
52
53 exit(2) terminate the calling process
54
56 libexplain version 1.4
57 Copyright (C) 2012 Peter Miller
58
59
60
61 explain_setresuid_or_die(3)