1explain_creat_or_die(3) Library Functions Manual explain_creat_or_die(3)
2
3
4
6 explain_creat_or_die - create and open a file creat and report errors
7
9 #include <libexplain/creat.h>
10 void explain_creat_or_die(const char *pathname, int mode);
11
13 The explain_creat_or_die function is used to call the creat(2) system
14 call. On failure an explanation will be printed to stderr, obtained
15 from explain_creat(3), and then the process terminates by calling
16 exit(EXIT_FAILURE).
17
18 This function is intended to be used in a fashion similar to the fol‐
19 lowing example:
20 explain_creat_or_die(pathname, mode);
21
22 pathname
23 The pathname, exactly as to be passed to the creat(2) system
24 call.
25
26 mode The mode, exactly as to be passed to the creat(2) system call.
27
28 Returns:
29 This function only returns on success. On failure, prints an
30 explanation and exits.
31
33 creat(2)
34 open and possibly create a file or device
35
36 explain_creat(3)
37 explain creat(2) errors
38
39 exit(2) terminate the calling process
40
42 libexplain version 0.40
43 Copyright (C) 2008 Peter Miller
44
45
46
47 explain_creat_or_die(3)