1explain_accept4_or_die(3) Library Functions Manual explain_accept4_or_die(3)
2
3
4
6 explain_accept4_or_die - accept a connection on a socket and report
7 errors
8
10 #include <libexplain/accept4.h>
11 int explain_accept4_or_die(int fildes, struct sockaddr *sock_addr,
12 socklen_t *sock_addr_size, int flags);
13 int explain_accept4_on_error(int fildes, struct sockaddr *sock_addr,
14 socklen_t *sock_addr_size, int flags);
15
17 The explain_accept4_or_die function is used to call the accept4(2) sys‐
18 tem call. On failure an explanation will be printed to stderr, obtained
19 from the explain_accept4(3) function, and then the process terminates
20 by calling exit(EXIT_FAILURE).
21
22 The explain_accept4_on_error function is used to call the accept4(2)
23 system call. On failure an explanation will be printed to stderr,
24 obtained from the explain_accept4(3) function, but still returns to the
25 caller.
26
27 fildes The fildes, exactly as to be passed to the accept4(2) system
28 call.
29
30 sock_addr
31 The sock_addr, exactly as to be passed to the accept4(2) system
32 call.
33
34 sock_addr_size
35 The sock_addr_size, exactly as to be passed to the accept4(2)
36 system call.
37
38 flags The flags, exactly as to be passed to the accept4(2) system
39 call.
40
42 The explain_accept4_or_die function only returns on success, see
43 accept4(2) for more information. On failure, prints an explanation and
44 exits, it does not return.
45
46 The explain_accept4_on_error function always returns the value return
47 by the wrapped accept4(2) system call.
48
50 The explain_accept4_or_die function is intended to be used in a fashion
51 similar to the following example:
52 int result = explain_accept4_or_die(fildes, sock_addr, sock_addr_size, flags);
53
55 accept4(2)
56 accept a connection on a socket
57
58 explain_accept4(3)
59 explain accept4(2) errors
60
61 exit(2) terminate the calling process
62
64 libexplain version 1.4
65 Copyright (C) 2009 Peter Miller
66
67
68
69 explain_accept4_or_die(3)