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
12 fgetpos - get current file position information
13
15 #include <stdio.h>
16
17 int fgetpos(FILE *restrict stream, fpos_t *restrict pos);
18
19
21 The fgetpos() function shall store the current values of the parse
22 state (if any) and file position indicator for the stream pointed to by
23 stream in the object pointed to by pos. The value stored contains
24 unspecified information usable by fsetpos() for repositioning the
25 stream to its position at the time of the call to fgetpos().
26
28 Upon successful completion, fgetpos() shall return 0; otherwise, it
29 shall return a non-zero value and set errno to indicate the error.
30
32 The fgetpos() function shall fail if:
33
34 EOVERFLOW
35 The current value of the file position cannot be represented
36 correctly in an object of type fpos_t.
37
38
39 The fgetpos() function may fail if:
40
41 EBADF The file descriptor underlying stream is not valid.
42
43 ESPIPE The file descriptor underlying stream is associated with a pipe,
44 FIFO, or socket.
45
46
47 The following sections are informative.
48
50 None.
51
53 None.
54
56 None.
57
59 None.
60
62 fopen(), ftell(), rewind(), ungetc(), the Base Definitions volume of
63 IEEE Std 1003.1-2001, <stdio.h>
64
66 Portions of this text are reprinted and reproduced in electronic form
67 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
68 -- Portable Operating System Interface (POSIX), The Open Group Base
69 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
70 Electrical and Electronics Engineers, Inc and The Open Group. In the
71 event of any discrepancy between this version and the original IEEE and
72 The Open Group Standard, the original IEEE and The Open Group Standard
73 is the referee document. The original Standard can be obtained online
74 at http://www.opengroup.org/unix/online.html .
75
76
77
78IEEE/The Open Group 2003 FGETPOS(3P)