1explain_pipe2_or_die(3) Library Functions Manual explain_pipe2_or_die(3)
2
3
4
6 explain_pipe2_or_die - create pipe and report errors
7
9 #include <libexplain/pipe2.h>
10 void explain_pipe2_or_die(int *fildes, int flags);
11 int explain_pipe2_on_error(int *fildes, int flags);
12
14 The explain_pipe2_or_die function is used to call the pipe2(2) system
15 call. On failure an explanation will be printed to stderr, obtained
16 from the explain_pipe2(3) function, and then the process terminates by
17 calling exit(EXIT_FAILURE).
18
19 The explain_pipe2_on_error function is used to call the pipe2(2) system
20 call. On failure an explanation will be printed to stderr, obtained
21 from the explain_pipe2(3) function, but still returns to the caller.
22
23 fildes The fildes, exactly as to be passed to the pipe2(2) system
24 call.
25
26 flags The flags, exactly as to be passed to the pipe2(2) system call.
27
29 The explain_pipe2_or_die function only returns on success, see pipe2(2)
30 for more information. On failure, prints an explanation and exits, it
31 does not return.
32
33 The explain_pipe2_on_error function always returns the value return by
34 the wrapped pipe2(2) system call.
35
37 The explain_pipe2_or_die function is intended to be used in a fashion
38 similar to the following example:
39 explain_pipe2_or_die(fildes, flags);
40
42 pipe2(2)
43 create pipe
44
45 explain_pipe2(3)
46 explain pipe2(2) errors
47
48 exit(2) terminate the calling process
49
51 libexplain version 1.4
52 Copyright (C) 2013 Peter Miller
53
54
55
56 explain_pipe2_or_die(3)