1explain_bind_or_die(3) Library Functions Manual explain_bind_or_die(3)
2
3
4
6 explain_bind_or_die - bind a name to a socket and report errors
7
9 #include <libexplain/bind.h>
10 void explain_bind_or_die(int fildes, const struct sockaddr *sock_addr,
11 int sock_addr_size);
12
14 The explain_bind_or_die function is used to call the bind(2) system
15 call. On failure an explanation will be printed to stderr, obtained
16 from explain_bind(3), and then the process terminates by calling
17 exit(EXIT_FAILURE).
18
19 This function is intended to be used in a fashion similar to the fol‐
20 lowing example:
21 explain_bind_or_die(fildes, sock_addr, sock_addr_size);
22
23 fildes The fildes, exactly as to be passed to the bind(2) system call.
24
25 sock_addr
26 The sock_addr, exactly as to be passed to the bind(2) system
27 call.
28
29 sock_addr_size
30 The sock_addr_size, exactly as to be passed to the bind(2) sys‐
31 tem call.
32
33 Returns:
34 This function only returns on success. On failure, prints an
35 explanation and exits.
36
38 bind(2) bind a name to a socket
39
40 explain_bind(3)
41 explain bind(2) errors
42
43 exit(2) terminate the calling process
44
46 libexplain version 1.4
47 Copyright (C) 2008 Peter Miller
48
49
50
51 explain_bind_or_die(3)