1explain_shmctl_or_die(3) Library Functions Manual explain_shmctl_or_die(3)
2
3
4
6 explain_shmctl_or_die - shared memory control and report errors
7
9 #include <libexplain/shmctl.h>
10 void explain_shmctl_or_die(int shmid, int command, struct shmid_ds
11 *data);
12 int explain_shmctl_on_error(int shmid, int command, struct shmid_ds
13 *data);
14
16 The explain_shmctl_or_die function is used to call the shmctl(2) system
17 call. On failure an explanation will be printed to stderr, obtained
18 from the explain_shmctl(3) function, and then the process terminates by
19 calling exit(EXIT_FAILURE).
20
21 The explain_shmctl_on_error function is used to call the shmctl(2) sys‐
22 tem call. On failure an explanation will be printed to stderr, obtained
23 from the explain_shmctl(3) function, but still returns to the caller.
24
25 shmid The shmid, exactly as to be passed to the shmctl(2) system
26 call.
27
28 command The command, exactly as to be passed to the shmctl(2) system
29 call.
30
31 data The data, exactly as to be passed to the shmctl(2) system call.
32
34 The explain_shmctl_or_die function only returns on success, see shm‐
35 ctl(2) for more information. On failure, prints an explanation and
36 exits, it does not return.
37
38 The explain_shmctl_on_error function always returns the value return by
39 the wrapped shmctl(2) system call.
40
42 The explain_shmctl_or_die function is intended to be used in a fashion
43 similar to the following example:
44 explain_shmctl_or_die(shmid, command, data);
45
47 shmctl(2)
48 shared memory control
49
50 explain_shmctl(3)
51 explain shmctl(2) errors
52
53 exit(2) terminate the calling process
54
56 libexplain version 1.4
57 Copyright (C) 2011 Peter Miller
58
59
60
61 explain_shmctl_or_die(3)