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