1explain_fdopen_or_die(3) Library Functions Manual explain_fdopen_or_die(3)
2
3
4
6 explain_fdopen_or_die - stream open functions and report errors
7
9 #include <libexplain/fdopen.h>
10 void explain_fdopen_or_die(int fd, const char *mode);
11
13 The explain_fdopen_or_die function is used to call the fdopen(3) system
14 call. On failure an explanation will be printed to stderr, obtained
15 from explain_fdopen(3), and then the process terminates by calling
16 exit(EXIT_FAILURE).
17
18 This function is intended to be used in a fashion similar to the fol‐
19 lowing example:
20 FILE *fp = explain_fdopen_or_die(fd, mode);
21
22 fd The fd, exactly as to be passed to the fdopen(3) system call.
23
24 mode The mode, exactly as to be passed to the fdopen(3) system call.
25
26 Returns:
27 This function only returns on success. On failure, prints an
28 explanation and exits.
29
31 fdopen(3)
32 stream open functions
33
34 explain_fdopen(3)
35 explain fdopen(3) errors
36
37 exit(2) terminate the calling process
38
40 libexplain version 1.4
41 Copyright (C) 2008 Peter Miller
42
43
44
45 explain_fdopen_or_die(3)