1explain_listen_or_die(3) Library Functions Manual explain_listen_or_die(3)
2
3
4
6 explain_listen_or_die - listen for connections on a socket and report
7 errors
8
10 #include <libexplain/listen.h>
11 void explain_listen_or_die(int fildes, int backlog);
12
14 The explain_listen_or_die function is used to call the listen(2) system
15 call. On failure an explanation will be printed to stderr, obtained
16 from explain_listen(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_listen_or_die(fildes, backlog);
22
23 fildes The fildes, exactly as to be passed to the listen(2) system
24 call.
25
26 backlog The backlog, exactly as to be passed to the listen(2) system
27 call.
28
29 Returns:
30 This function only returns on success. On failure, prints an
31 explanation and exits.
32
34 listen(2)
35 listen for connections on a socket
36
37 explain_listen(3)
38 explain listen(2) errors
39
40 exit(2) terminate the calling process
41
43 libexplain version 1.4
44 Copyright (C) 2008 Peter Miller
45
46
47
48 explain_listen_or_die(3)