1explain_lseek_or_die(3) Library Functions Manual explain_lseek_or_die(3)
2
3
4
6 explain_lseek_or_die - reposition file offset and report errors
7
9 #include <libexplain/lseek.h>
10 long long explain_lseek_or_die(int fildes, long long offset, int
11 whence);
12
14 The explain_lseek_or_die function is used to call the lseek(2) system
15 call. On failure an explanation will be printed to stderr, obtained
16 from explain_lseek(3), and then the process terminates by calling
17 exit(EXIT_FAILURE).
18
19 This function is intended to be used in a fashion similar to the fol‐
20 lowing example:
21 long long result = explain_lseek_or_die(fildes, offset, whence);
22
23 fildes The fildes, exactly as to be passed to the lseek(2) system
24 call.
25
26 offset The offset, exactly as to be passed to the lseek(2) system
27 call.
28
29 whence The whence, exactly as to be passed to the lseek(2) system
30 call.
31
32 Returns:
33 On successful, returns the resulting offset location as mea‐
34 sured in bytes from the beginning of the file. On failure,
35 prints an explanation and exits.
36
38 lseek(2)
39 reposition file offset
40
41 explain_lseek(3)
42 explain lseek(2) errors
43
44 exit(2) terminate the calling process
45
47 libexplain version 1.4
48 Copyright (C) 2008 Peter Miller
49
50
51
52 explain_lseek_or_die(3)