1explain_setresgid_or_die(3)Library Functions Manualexplain_setresgid_or_die(3)
2
3
4

NAME

6       explain_setresgid_or_die - set r/e/s group ID and report errors
7

SYNOPSIS

9       #include <libexplain/setresgid.h>
10       void explain_setresgid_or_die(gid_t rgid, gid_t egid, gid_t sgid);
11       int explain_setresgid_on_error(gid_t rgid, gid_t egid, gid_t sgid);
12

DESCRIPTION

14       The  explain_setresgid_or_die function is used to call the setresgid(2)
15       system call. On failure an  explanation  will  be  printed  to  stderr,
16       obtained  from  the explain_setresgid(3) function, and then the process
17       terminates by calling exit(EXIT_FAILURE).
18
19       The explain_setresgid_on_error function is used  to  call  the  setres‐
20       gid(2)  system  call.  On  failure  an  explanation  will be printed to
21       stderr, obtained from  the  explain_setresgid(3)  function,  but  still
22       returns to the caller.
23
24       rgid    The  rgid,  exactly  as to be passed to the setresgid(2) system
25               call.
26
27       egid    The egid, exactly as to be passed to  the  setresgid(2)  system
28               call.
29
30       sgid    The  sgid,  exactly  as to be passed to the setresgid(2) system
31               call.
32

RETURN VALUE

34       The explain_setresgid_or_die function  only  returns  on  success,  see
35       setresgid(2)  for  more  information. On failure, prints an explanation
36       and exits, it does not return.
37
38       The explain_setresgid_on_error function always returns the value return
39       by the wrapped setresgid(2) system call.
40

EXAMPLE

42       The explain_setresgid_or_die function is intended to be used in a fash‐
43       ion similar to the following example:
44              explain_setresgid_or_die(rgid, egid, sgid);
45

SEE ALSO

47       setresgid(2)
48               set real, effective and saved group ID
49
50       explain_setresgid(3)
51               explain setresgid(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_setresgid_or_die(3)
Impressum