1explain_setpgid_or_die(3) Library Functions Manual explain_setpgid_or_die(3)
2
3
4
6 explain_setpgid_or_die - set process group and report errors
7
9 #include <libexplain/setpgid.h>
10 void explain_setpgid_or_die(pid_t pid, pid_t pgid);
11 int explain_setpgid_on_error(pid_t pid, pid_t pgid);
12
14 The explain_setpgid_or_die function is used to call the setpgid(2) sys‐
15 tem call. On failure an explanation will be printed to stderr, obtained
16 from the explain_setpgid(3) function, and then the process terminates
17 by calling exit(EXIT_FAILURE).
18
19 The explain_setpgid_on_error function is used to call the setpgid(2)
20 system call. On failure an explanation will be printed to stderr,
21 obtained from the explain_setpgid(3) function, but still returns to the
22 caller.
23
24 pid The pid, exactly as to be passed to the setpgid(2) system call.
25
26 pgid The pgid, exactly as to be passed to the setpgid(2) system
27 call.
28
30 The explain_setpgid_or_die function only returns on success, see
31 setpgid(2) for more information. On failure, prints an explanation and
32 exits, it does not return.
33
34 The explain_setpgid_on_error function always returns the value return
35 by the wrapped setpgid(2) system call.
36
38 The explain_setpgid_or_die function is intended to be used in a fashion
39 similar to the following example:
40 explain_setpgid_or_die(pid, pgid);
41
43 setpgid(2)
44 set process group
45
46 explain_setpgid(3)
47 explain setpgid(2) errors
48
49 exit(2) terminate the calling process
50
52 libexplain version 1.4
53 Copyright (C) 2011 Peter Miller
54
55
56
57 explain_setpgid_or_die(3)