1explain_setregid_or_die(3) Library Functions Manual explain_setregid_or_die(3)
2
3
4
6 explain_setregid_or_die - set real and/or effective group ID and report
7 errors
8
10 #include <libexplain/setregid.h>
11 void explain_setregid_or_die(gid_t rgid, gid_t egid);
12 int explain_setregid_on_error(gid_t rgid, gid_t egid);
13
15 The explain_setregid_or_die function is used to call the setregid(2)
16 system call. On failure an explanation will be printed to stderr,
17 obtained from the explain_setregid(3) function, and then the process
18 terminates by calling exit(EXIT_FAILURE).
19
20 The explain_setregid_on_error function is used to call the setregid(2)
21 system call. On failure an explanation will be printed to stderr,
22 obtained from the explain_setregid(3) function, but still returns to
23 the caller.
24
25 rgid The rgid, exactly as to be passed to the setregid(2) system
26 call.
27
28 egid The egid, exactly as to be passed to the setregid(2) system
29 call.
30
32 The explain_setregid_or_die function only returns on success, see
33 setregid(2) for more information. On failure, prints an explanation and
34 exits, it does not return.
35
36 The explain_setregid_on_error function always returns the value return
37 by the wrapped setregid(2) system call.
38
40 The explain_setregid_or_die function is intended to be used in a fash‐
41 ion similar to the following example:
42 explain_setregid_or_die(rgid, egid);
43
45 setregid(2)
46 set real and/or effective group ID
47
48 explain_setregid(3)
49 explain setregid(2) errors
50
51 exit(2) terminate the calling process
52
54 libexplain version 1.4
55 Copyright (C) 2012 Peter Miller
56
57
58
59 explain_setregid_or_die(3)