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