1FGETPOS(3P) POSIX Programmer's Manual FGETPOS(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 fgetpos — get current file position information
14
16 #include <stdio.h>
17
18 int fgetpos(FILE *restrict stream, fpos_t *restrict pos);
19
21 The functionality described on this reference page is aligned with the
22 ISO C standard. Any conflict between the requirements described here
23 and the ISO C standard is unintentional. This volume of POSIX.1‐2008
24 defers to the ISO C standard.
25
26 The fgetpos() function shall store the current values of the parse
27 state (if any) and file position indicator for the stream pointed to by
28 stream in the object pointed to by pos. The value stored contains
29 unspecified information usable by fsetpos() for repositioning the
30 stream to its position at the time of the call to fgetpos().
31
32 The fgetpos() function shall not change the setting of errno if suc‐
33 cessful.
34
36 Upon successful completion, fgetpos() shall return 0; otherwise, it
37 shall return a non-zero value and set errno to indicate the error.
38
40 The fgetpos() function shall fail if:
41
42 EBADF The file descriptor underlying stream is not valid.
43
44 EOVERFLOW
45 The current value of the file position cannot be represented
46 correctly in an object of type fpos_t.
47
48 ESPIPE The file descriptor underlying stream is associated with a pipe,
49 FIFO, or socket.
50
51 The following sections are informative.
52
54 None.
55
57 None.
58
60 None.
61
63 None.
64
66 Section 2.5, Standard I/O Streams, fopen(), ftell(), rewind(), ungetc()
67
68 The Base Definitions volume of POSIX.1‐2008, <stdio.h>
69
71 Portions of this text are reprinted and reproduced in electronic form
72 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
73 -- Portable Operating System Interface (POSIX), The Open Group Base
74 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
75 cal and Electronics Engineers, Inc and The Open Group. (This is
76 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
77 event of any discrepancy between this version and the original IEEE and
78 The Open Group Standard, the original IEEE and The Open Group Standard
79 is the referee document. The original Standard can be obtained online
80 at http://www.unix.org/online.html .
81
82 Any typographical or formatting errors that appear in this page are
83 most likely to have been introduced during the conversion of the source
84 files to man page format. To report such errors, see https://www.ker‐
85 nel.org/doc/man-pages/reporting_bugs.html .
86
87
88
89IEEE/The Open Group 2013 FGETPOS(3P)