1explain_tempnam_or_die(3) Library Functions Manual explain_tempnam_or_die(3)
2
3
4
6 explain_tempnam_or_die - create a name for a temporary file and report
7 errors
8
10 #include <libexplain/tempnam.h>
11 char *explain_tempnam_or_die(const char *dir, const char *prefix);
12 char *explain_tempnam_on_error(const char *dir, const char *prefix);
13
15 The explain_tempnam_or_die function is used to call the tempnam(3) sys‐
16 tem call. On failure an explanation will be printed to stderr, obtained
17 from the explain_tempnam(3) function, and then the process terminates
18 by calling exit(EXIT_FAILURE).
19
20 The explain_tempnam_on_error function is used to call the tempnam(3)
21 system call. On failure an explanation will be printed to stderr,
22 obtained from the explain_tempnam(3) function, but still returns to the
23 caller.
24
25 dir The dir, exactly as to be passed to the tempnam(3) system call.
26
27 prefix The prefix, exactly as to be passed to the tempnam(3) system
28 call.
29
31 The explain_tempnam_or_die function only returns on success, see temp‐
32 nam(3) for more information. On failure, prints an explanation and
33 exits, it does not return.
34
35 The explain_tempnam_on_error function always returns the value return
36 by the wrapped tempnam(3) system call.
37
39 The explain_tempnam_or_die function is intended to be used in a fashion
40 similar to the following example:
41 char *result = explain_tempnam_or_die(dir, prefix);
42
44 tempnam(3)
45 create a name for a temporary file
46
47 explain_tempnam(3)
48 explain tempnam(3) errors
49
50 exit(2) terminate the calling process
51
53 libexplain version 1.4
54 Copyright (C) 2009 Peter Miller
55
56
57
58 explain_tempnam_or_die(3)