1explain_mknod_or_die(3) Library Functions Manual explain_mknod_or_die(3)
2
3
4
6 explain_mknod_or_die - create a special or ordinary file and report
7 errors
8
10 #include <libexplain/mknod.h>
11 void explain_mknod_or_die(const char *pathname, mode_t mode, dev_t
12 dev);
13 int explain_mknod_on_error(const char *pathname, mode_t mode, dev_t
14 dev);
15
17 The explain_mknod_or_die function is used to call the mknod(2) system
18 call. On failure an explanation will be printed to stderr, obtained
19 from the explain_mknod(3) function, and then the process terminates by
20 calling exit(EXIT_FAILURE).
21
22 The explain_mknod_on_error function is used to call the mknod(2) system
23 call. On failure an explanation will be printed to stderr, obtained
24 from the explain_mknod(3) function, but still returns to the caller.
25
26 pathname
27 The pathname, exactly as to be passed to the mknod(2) system
28 call.
29
30 mode The mode, exactly as to be passed to the mknod(2) system call.
31
32 dev The dev, exactly as to be passed to the mknod(2) system call.
33
35 The explain_mknod_or_die function only returns on success, see mknod(2)
36 for more information. On failure, prints an explanation and exits, it
37 does not return.
38
39 The explain_mknod_on_error function always returns the value return by
40 the wrapped mknod(2) system call.
41
43 The explain_mknod_or_die function is intended to be used in a fashion
44 similar to the following example:
45 explain_mknod_or_die(pathname, mode, dev);
46
48 mknod(2)
49 create a special or ordinary file
50
51 explain_mknod(3)
52 explain mknod(2) errors
53
54 exit(2) terminate the calling process
55
57 libexplain version 1.4
58 Copyright (C) 2009 Peter Miller
59
60
61
62 explain_mknod_or_die(3)