1explain_getsockopt_or_die(3)Library Functions Manualexplain_getsockopt_or_die(3)
2
3
4
6 explain_getsockopt_or_die - get and set options on sockets and report
7 errors
8
10 #include <libexplain/getsockopt.h>
11 void explain_getsockopt_or_die(int fildes, int level, int name, void
12 *data, socklen_t *data_size);
13
15 The explain_getsockopt_or_die function is used to call the getsock‐
16 opt(2) system call. On failure an explanation will be printed to
17 stderr, obtained from explain_getsockopt(3), and then the process ter‐
18 minates by calling exit(EXIT_FAILURE).
19
20 This function is intended to be used in a fashion similar to the fol‐
21 lowing example:
22 explain_getsockopt_or_die(fildes, level, name, data, data_size);
23
24 fildes The fildes, exactly as to be passed to the getsockopt(2) system
25 call.
26
27 level The level, exactly as to be passed to the getsockopt(2) system
28 call.
29
30 name The name, exactly as to be passed to the getsockopt(2) system
31 call.
32
33 data The data, exactly as to be passed to the getsockopt(2) system
34 call.
35
36 data_size
37 The data_size, exactly as to be passed to the getsockopt(2)
38 system call.
39
40 Returns:
41 This function only returns on success. On failure, prints an
42 explanation and exits.
43
45 getsockopt(2)
46 get and set options on sockets
47
48 explain_getsockopt(3)
49 explain getsockopt(2) errors
50
51 exit(2) terminate the calling process
52
54 libexplain version 0.40
55 Copyright (C) 2009 Peter Miller
56
57
58
59 explain_getsockopt_or_die(3)