1explain_mount_or_die(3) Library Functions Manual explain_mount_or_die(3)
2
3
4
6 explain_mount_or_die - mount file system and report errors
7
9 #include <libexplain/mount.h>
10 void explain_mount_or_die(const char *source, const char *target, const
11 char *file_systems_type, unsigned long flags, const void *data);
12 int explain_mount_on_error(const char *source, const char *target,
13 const char *file_systems_type, unsigned long flags, const void *data);
14
16 The explain_mount_or_die function is used to call the mount(2) system
17 call. On failure an explanation will be printed to stderr, obtained
18 from the explain_mount(3) function, and then the process terminates by
19 calling exit(EXIT_FAILURE).
20
21 The explain_mount_on_error function is used to call the mount(2) system
22 call. On failure an explanation will be printed to stderr, obtained
23 from the explain_mount(3) function, but still returns to the caller.
24
25 source The source, exactly as to be passed to the mount(2) system
26 call.
27
28 target The target, exactly as to be passed to the mount(2) system
29 call.
30
31 file_systems_type
32 The file_systems_type, exactly as to be passed to the mount(2)
33 system call.
34
35 flags The flags, exactly as to be passed to the mount(2) system call.
36
37 data The data, exactly as to be passed to the mount(2) system call.
38
40 The explain_mount_or_die function only returns on success, see mount(2)
41 for more information. On failure, prints an explanation and exits, it
42 does not return.
43
44 The explain_mount_on_error function always returns the value return by
45 the wrapped mount(2) system call.
46
48 The explain_mount_or_die function is intended to be used in a fashion
49 similar to the following example:
50 explain_mount_or_die(source, target, file_systems_type, flags, data);
51
53 mount(2)
54 mount file system
55
56 explain_mount(3)
57 explain mount(2) errors
58
59 exit(2) terminate the calling process
60
62 libexplain version 1.4
63 Copyright (C) 2013 Peter Miller
64
65
66
67 explain_mount_or_die(3)