1explain_fsync_or_die(3) Library Functions Manual explain_fsync_or_die(3)
2
3
4
6 explain_fsync_or_die - synchronize a file with storage device and
7 report errors
8
10 #include <libexplain/fsync.h>
11 void explain_fsync_or_die(int fildes);
12 int explain_fsync_on_error(int fildes);
13
15 The explain_fsync_or_die function is used to call the fsync(2) system
16 call. On failure an explanation will be printed to stderr, obtained
17 from the explain_fsync(3) function, and then the process terminates by
18 calling exit(EXIT_FAILURE).
19
20 The explain_fsync_on_error function is used to call the fsync(2) system
21 call. On failure an explanation will be printed to stderr, obtained
22 from the explain_fsync(3) function, but still returns to the caller.
23
24 fildes The fildes, exactly as to be passed to the fsync(2) system
25 call.
26
28 The explain_fsync_or_die function only returns on success, see fsync(2)
29 for more information. On failure, prints an explanation and exits, it
30 does not return.
31
32 The explain_fsync_on_error function always returns the value return by
33 the wrapped fsync(2) system call.
34
36 The explain_fsync_or_die function is intended to be used in a fashion
37 similar to the following example:
38 explain_fsync_or_die(fildes);
39
41 fsync(2)
42 synchronize a file's inācore state with storage device
43
44 explain_fsync(3)
45 explain fsync(2) errors
46
47 exit(2) terminate the calling process
48
50 libexplain version 1.4
51 Copyright (C) 2009 Peter Miller
52
53
54
55 explain_fsync_or_die(3)