1explain_vfprintf_or_die(3) Library Functions Manual explain_vfprintf_or_die(3)
2
3
4
6 explain_vfprintf_or_die - formatted output conversion and report errors
7
9 #include <libexplain/vfprintf.h>
10 void explain_vfprintf_or_die(FILE *fp, const char *format, va_list ap);
11 int explain_vfprintf_on_error(FILE *fp, const char *format, va_list
12 ap);
13
15 The explain_vfprintf_or_die function is used to call the vfprintf(3)
16 system call. On failure an explanation will be printed to stderr,
17 obtained from the explain_vfprintf(3) function, and then the process
18 terminates by calling exit(EXIT_FAILURE).
19
20 The explain_vfprintf_on_error function is used to call the vfprintf(3)
21 system call. On failure an explanation will be printed to stderr,
22 obtained from the explain_vfprintf(3) function, but still returns to
23 the caller.
24
25 fp The fp, exactly as to be passed to the vfprintf(3) system call.
26
27 format The format, exactly as to be passed to the vfprintf(3) system
28 call.
29
30 ap The ap, exactly as to be passed to the vfprintf(3) system call.
31
33 The explain_vfprintf_or_die function only returns on success, see
34 vfprintf(3) for more information. On failure, prints an explanation and
35 exits, it does not return.
36
37 The explain_vfprintf_on_error function always returns the value return
38 by the wrapped vfprintf(3) system call.
39
41 The explain_vfprintf_or_die function is intended to be used in a fash‐
42 ion similar to the following example:
43 explain_vfprintf_or_die(fp, format, ap);
44
46 vfprintf(3)
47 formatted output conversion
48
49 explain_vfprintf(3)
50 explain vfprintf(3) errors
51
52 exit(2) terminate the calling process
53
55 libexplain version 0.40
56 Copyright (C) 2010 Peter Miller
57
58
59
60 explain_vfprintf_or_die(3)