FEOF(3P)
π FEOF(3P) β bestie, it's the POSIX Programmer's Manual π
okay so real quick before we dive in β this page lives in the POSIX Programmer's Manual, and there's a little disclaimer energy up top that you absolutely need to know:
The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
like, don't come for me if Linux does its own thing, go read the Linux page, okay? π«Ά
πΈ NAME πΈ
feof β test end-of-file indicator on a stream
like, "hey is this stream done?" detector. that's the whole job. π
β¨ SYNOPSIS β¨
#include <stdio.h>
int feof(FILE *stream);
π¦ DESCRIPTION π¦
okay so first thing first, the tea: 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 β so if you spot one, it's not a feature, it's an accident π. This volume of POSIX.1β2017 defers to the ISO C standard, periodt.
Now the actual vibe:
The feof() function shall test the end-of-file indicator for the stream pointed to by stream.
and here's the lowkey iconic part β the feof() function shall not change the setting of errno if stream is valid. no cap. it just peeks. it does not touch your errno. respectful king behavior π.
β RETURN VALUE β
The feof() function shall return non-zero if and only if the end-of-file indicator is set for stream.
if and only if. fr fr. not "sometimes", not "vibes-based" β it's a strict biconditional, bestie. π
π ERRORS π
No errors are defined.
and just so you know:
The following sections are informative.
(translation: the next few sections are β¨ lore β¨, not rules.)
π EXAMPLES π
None.
sad. empty. not a single example to snack on π
π APPLICATION USAGE π
None.
also empty. the void. she's giving minimalist π§
π RATIONALE π
None.
they really said "no thoughts, head empty" for this one π
π₯ FUTURE DIRECTIONS π₯
None.
nothing coming down the pipeline. she's stable. she's settled. main character energy that doesn't need a sequel π
π«Ά SEE ALSO π«Ά
clearerr()ferror()fopen()
and also β the Base Definitions volume of POSIX.1β2017, <stdio.h> β¨
π COPYRIGHT π
okay bestie, legal moment, don't skip it, it's important:
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. 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 .
and that's the whole page, bestie π go forth and check your EOF indicators responsibly
IEEE/The Open Group, 2017 β FEOF(3P), signing off πβ¨
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms