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