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