1explain_fwrite_or_die(3) Library Functions Manual explain_fwrite_or_die(3)
2
3
4
6 explain_fwrite_or_die - binary stream output and report errors
7
9 #include <libexplain/fwrite.h>
10 size_t explain_fwrite_or_die(const void *ptr, size_t size, size_t
11 nmemb, FILE *fp);
12
14 The explain_fwrite_or_die function is used to call the fwrite(3) system
15 call. On failure an explanation will be printed to stderr, obtained
16 from explain_fwrite(3), and then the process terminates by calling
17 exit(EXIT_FAILURE).
18
19 This function is intended to be used in a fashion similar to the fol‐
20 lowing example:
21 size_t result = explain_fwrite_or_die(ptr, size, nmemb, fp);
22
23 ptr The ptr, exactly as to be passed to the fwrite(3) system call.
24
25 size The size, exactly as to be passed to the fwrite(3) system call.
26
27 nmemb The nmemb, exactly as to be passed to the fwrite(3) system
28 call.
29
30 fp The fp, exactly as to be passed to the fwrite(3) system call.
31
32 Returns:
33 This function only returns on success. On failure, prints an
34 explanation and exits.
35
37 fwrite(3)
38 binary stream output
39
40 explain_fwrite(3)
41 explain fwrite(3) errors
42
43 exit(2) terminate the calling process
44
46 libexplain version 0.40
47 Copyright (C) 2008 Peter Miller
48
49
50
51 explain_fwrite_or_die(3)