1explain_eventfd_or_die(3) Library Functions Manual explain_eventfd_or_die(3)
2
3
4
6 explain_eventfd_or_die - create event notify file descriptor and report
7 errors
8
10 #include <libexplain/eventfd.h>
11 int explain_eventfd_or_die(unsigned int initval, int flags);
12 int explain_eventfd_on_error(unsigned int initval, int flags);
13
15 The explain_eventfd_or_die function is used to call the eventfd(2) sys‐
16 tem call. On failure an explanation will be printed to stderr, obtained
17 from the explain_eventfd(3) function, and then the process terminates
18 by calling exit(EXIT_FAILURE).
19
20 The explain_eventfd_on_error function is used to call the eventfd(2)
21 system call. On failure an explanation will be printed to stderr,
22 obtained from the explain_eventfd(3) function, but still returns to the
23 caller.
24
25 initval The initval, exactly as to be passed to the eventfd(2) system
26 call.
27
28 flags The flags, exactly as to be passed to the eventfd(2) system
29 call.
30
32 The explain_eventfd_or_die function only returns on success, see
33 eventfd(2) for more information. On failure, prints an explanation and
34 exits, it does not return.
35
36 The explain_eventfd_on_error function always returns the value return
37 by the wrapped eventfd(2) system call.
38
40 The explain_eventfd_or_die function is intended to be used in a fashion
41 similar to the following example:
42 int result = explain_eventfd_or_die(initval, flags);
43
45 eventfd(2)
46 create a file descriptor for event notification
47
48 explain_eventfd(3)
49 explain eventfd(2) errors
50
51 exit(2) terminate the calling process
52
54 libexplain version 1.4
55 Copyright (C) 2009 Peter Miller
56
57
58
59 explain_eventfd_or_die(3)