FGETPOS(3POSIX)
π FGETPOS(3POSIX) π
okay bestie, so this little gem lives in the POSIX Programmer's Manual (yes, the 3POSIX one, we're fancy here) β¨
πΈ PROLOG πΈ
okay so before we even get into it, heads up: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so like, go consult the corresponding Linux manual page for the deets on Linux behavior β or honestly, the interface may not even be implemented on Linux at all. vibe check first, always π«Ά
π NAME π
fgetpos β get current file position information π
β¨ SYNOPSIS β¨
#include <stdio.h>
int fgetpos(FILE *restrict stream, fpos_t *restrict pos);
π¦ DESCRIPTION π¦
so like, the functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional, no cap. This volume of POSIX.1-2017 defers to the ISO C standard. periodt. π
The fgetpos() function shall store the current values of the parse state (if any) and file position indicator for the stream pointed to by stream in the object pointed to by pos. The value stored contains unspecified information usable by fsetpos() for repositioning the stream to its position at the time of the call to fgetpos(). it's giving bookmark energy, fr fr π
The fgetpos() function shall not change the setting of errno if successful. so if it ate, it leaves errno completely alone. iconic behavior honestly π
π RETURN VALUE π
Upon successful completion, fgetpos() shall return 0 β slay. Otherwise, it shall return a non-zero value and set errno to indicate the error. not slay. π
π₯ ERRORS π₯
The fgetpos() function shall fail if:
EBADFβ The file descriptor underlyingstreamis not valid. bestie that stream is not real, i'm so sorry πEOVERFLOWβ The current value of the file position cannot be represented correctly in an object of typefpos_t. it literally does not fit, the number is too big for the little box πESPIPEβ The file descriptor underlyingstreamis associated with a pipe, FIFO, or socket. you cannot seek a pipe, that's not a thing, stop trying π«
ngl the following sections are informative, so they're the bonus content, not the main quest β¨
π EXAMPLES π
None. (nothing here, bestie, the examples section is empty, we move) π
π APPLICATION USAGE π
None. (also empty! two for two π)
π RATIONALE π
None. (empty again, this page is lowkey a minimalist queen π)
β FUTURE DIRECTIONS β
None. (yep. empty. the void. π)
π§ SEE ALSO π§
- Section 2.5, Standard I/O Streams
fopen()ftell()rewind()ungetc()- The Base Definitions volume of POSIX.1-2017,
<stdio.h>
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document β like, they're the main character, this page is just the group chat recap. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
okay and that's the whole thing!! πΈπβ¨ this absolute baddie of a page is brought to you by IEEE/The Open Group, 2017, and the manual page is FGETPOS(3POSIX) β go forth and get those file positions, bestie, i'm obsessed with you π«Άππ
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms