1explain_setsid_or_die(3) Library Functions Manual explain_setsid_or_die(3)
2
3
4
6 explain_setsid_or_die - sets process group ID and report errors
7
9 #include <libexplain/setsid.h>
10 pid_t explain_setsid_or_die(void);
11 pid_t explain_setsid_on_error(void);
12
14 The explain_setsid_or_die function is used to call the setsid(2) system
15 call. On failure an explanation will be printed to stderr, obtained
16 from the explain_setsid(3) function, and then the process terminates by
17 calling exit(EXIT_FAILURE).
18
19 The explain_setsid_on_error function is used to call the setsid(2) sys‐
20 tem call. On failure an explanation will be printed to stderr, obtained
21 from the explain_setsid(3) function, but still returns to the caller.
22
24 The explain_setsid_or_die function only returns on success, see set‐
25 sid(2) for more information. On failure, prints an explanation and
26 exits, it does not return.
27
28 The explain_setsid_on_error function always returns the value return by
29 the wrapped setsid(2) system call.
30
32 The explain_setsid_or_die function is intended to be used in a fashion
33 similar to the following example:
34 explain_setsid_or_die();
35
37 setsid(2)
38 creates a session and sets the process group ID
39
40 explain_setsid(3)
41 explain setsid(2) errors
42
43 exit(2) terminate the calling process
44
46 libexplain version 1.4
47 Copyright (C) 2011 Peter Miller
48
49
50
51 explain_setsid_or_die(3)