FERROR(3POSIX)
πΈ FERROR(3POSIX) β the POSIX Programmer's Manual, bestie edition πΈ
okay so real talk before we even start: this page lives in the POSIX Programmer's Manual (that's the 3POSIX section, mwah). But heads up β the Linux implementation of this interface may differ from what's written here (so like, go check the corresponding Linux manual page for the actual Linux behavior if that's your situation), or honestly the interface might not even be implemented on Linux at all. π
π PROLOG π
This manual page is part of the POSIX Programmer's Manual. 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. That's it, that's the whole prolog, no notes. β¨
π NAME π
ferror β test error indicator on a stream. that's the vibe check. π¦
β¨ SYNOPSIS β¨
#include <stdio.h>
int ferror(FILE *stream);
like, you include <stdio.h> and then you call it. iconic behavior honestly.
π DESCRIPTION π
So the functionality described on this reference page is aligned with the ISO C standard. And if there's any conflict between the requirements described here and the ISO C standard? That's unintentional, fr fr, no cap. This volume of POSIX.1β2017 defers to the ISO C standard. periodt. π
The ferror() function shall test the error indicator for the stream pointed to by stream. that's literally its whole job and it does it flawlessly.
And here's the lil detail everyone sleeps on: the ferror() function shall not change the setting of errno if stream is valid. like, it's polite. it minds its own business. π«Ά
π RETURN VALUE π
The ferror() function shall return non-zero if and only if the error indicator is set for stream. so if the error indicator is set β non-zero. if it's not set β you get zero. no in-between, no chaos, just truth. β
π ERRORS π
No errors are defined. not a single one. this function has no enemies. π
The following sections are informative. (translation: the next few sections are lore, not law, bestie π§)
π EXAMPLES π
None. (we stay humble, we stay mysterious. π)
π¦ APPLICATION USAGE π¦
None. (same energy. nothing to add, it just works. β¨)
π RATIONALE π
None. (the reasoning is β¨vibesβ¨ and also there is none. π)
π₯ FUTURE DIRECTIONS π₯
None. (the future is bright but this section is empty. π)
π SEE ALSO π
clearerr()feof()fopen()
The Base Definitions volume of POSIX.1β2017, <stdio.h>.
go read those, they're the friend group. π
πΈ 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. 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 that's the whole page, you're officially aferror()girlie now. non-zero means the error indicator is SET, zero means it's not, anderrnostays exactly where it was if your stream is valid. go forth and slay. π
IEEE/The Open Group β 2017 β FERROR(3POSIX) π that's the source, the version and the date, mwah, bye bestie! πβ¨π¦
π¦ 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