1explain_fsetpos_or_die(3) Library Functions Manual explain_fsetpos_or_die(3)
2
3
4
6 explain_fsetpos_or_die - reposition a stream and report errors
7
9 #include <libexplain/fsetpos.h>
10 void explain_fsetpos_or_die(FILE *fp, fpos_t *pos);
11 int explain_fsetpos_on_error(FILE *fp, fpos_t *pos);
12
14 The explain_fsetpos_or_die function is used to call the fsetpos(3) sys‐
15 tem call. On failure an explanation will be printed to stderr, obtained
16 from the explain_fsetpos(3) function, and then the process terminates
17 by calling exit(EXIT_FAILURE).
18
19 The explain_fsetpos_on_error function is used to call the fsetpos(3)
20 system call. On failure an explanation will be printed to stderr,
21 obtained from the explain_fsetpos(3) function, but still returns to the
22 caller.
23
24 fp The fp, exactly as to be passed to the fsetpos(3) system call.
25
26 pos The pos, exactly as to be passed to the fsetpos(3) system call.
27
29 The explain_fsetpos_or_die function only returns on success, see fset‐
30 pos(3) for more information. On failure, prints an explanation and
31 exits, it does not return.
32
33 The explain_fsetpos_on_error function always returns the value return
34 by the wrapped fsetpos(3) system call.
35
37 The explain_fsetpos_or_die function is intended to be used in a fashion
38 similar to the following example:
39 explain_fsetpos_or_die(fp, pos);
40
42 fsetpos(3)
43 reposition a stream
44
45 explain_fsetpos(3)
46 explain fsetpos(3) errors
47
48 exit(2) terminate the calling process
49
51 libexplain version 1.4
52 Copyright (C) 2010 Peter Miller
53
54
55
56 explain_fsetpos_or_die(3)