1explain_puts_or_die(3) Library Functions Manual explain_puts_or_die(3)
2
3
4
6 explain_puts_or_die - write a string and a newline to stdout and report
7 errors
8
10 #include <libexplain/puts.h>
11 void explain_puts_or_die(const char *s);
12 int explain_puts_on_error(const char *s);
13
15 The explain_puts_or_die function is used to call the puts(3) system
16 call. On failure an explanation will be printed to stderr, obtained
17 from the explain_puts(3) function, and then the process terminates by
18 calling exit(EXIT_FAILURE).
19
20 The explain_puts_on_error function is used to call the puts(3) system
21 call. On failure an explanation will be printed to stderr, obtained
22 from the explain_puts(3) function, but still returns to the caller.
23
24 s The s, exactly as to be passed to the puts(3) system call.
25
27 The explain_puts_or_die function only returns on success, see puts(3)
28 for more information. On failure, prints an explanation and exits, it
29 does not return.
30
31 The explain_puts_on_error function always returns the value return by
32 the wrapped puts(3) system call.
33
35 The explain_puts_or_die function is intended to be used in a fashion
36 similar to the following example:
37 explain_puts_or_die(s);
38
40 puts(3) write a string and a trailing newline to stdout
41
42 explain_puts(3)
43 explain puts(3) errors
44
45 exit(2) terminate the calling process
46
48 libexplain version 0.40
49 Copyright (C) 2009 Peter Miller
50
51
52
53 explain_puts_or_die(3)