1explain_socketpair_or_die(3)Library Functions Manualexplain_socketpair_or_die(3)
2
3
4
6 explain_socketpair_or_die - create pair of connected sockets and report
7 errors
8
10 #include <libexplain/socketpair.h>
11 void explain_socketpair_or_die(int domain, int type, int protocol, int
12 *sv);
13 int explain_socketpair_on_error(int domain, int type, int protocol, int
14 *sv);
15
17 The explain_socketpair_or_die function is used to call the socket‐
18 pair(2) system call. On failure an explanation will be printed to
19 stderr, obtained from the explain_socketpair(3) function, and then the
20 process terminates by calling exit(EXIT_FAILURE).
21
22 The explain_socketpair_on_error function is used to call the socket‐
23 pair(2) system call. On failure an explanation will be printed to
24 stderr, obtained from the explain_socketpair(3) function, but still
25 returns to the caller.
26
27 domain The domain, exactly as to be passed to the socketpair(2) system
28 call.
29
30 type The type, exactly as to be passed to the socketpair(2) system
31 call.
32
33 protocol
34 The protocol, exactly as to be passed to the socketpair(2) sys‐
35 tem call.
36
37 sv The sv, exactly as to be passed to the socketpair(2) system
38 call.
39
41 The explain_socketpair_or_die function only returns on success, see
42 socketpair(2) for more information. On failure, prints an explanation
43 and exits, it does not return.
44
45 The explain_socketpair_on_error function always returns the value
46 return by the wrapped socketpair(2) system call.
47
49 The explain_socketpair_or_die function is intended to be used in a
50 fashion similar to the following example:
51 explain_socketpair_or_die(domain, type, protocol, sv);
52
54 socketpair(2)
55 create a pair of connected sockets
56
57 explain_socketpair(3)
58 explain socketpair(2) errors
59
60 exit(2) terminate the calling process
61
63 libexplain version 0.40
64 Copyright (C) 2010 Peter Miller
65
66
67
68 explain_socketpair_or_die(3)