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