fcloseall(3)
β¨ fcloseall(3) β¨
okay bestie, so this one lives in the Library Functions Manual π β it's a libc era icon and we're gonna get into it.
πΈ NAME πΈ
fcloseall β close all open streams. every single one. no survivors. periodt π
π LIBRARY π
Standard C library (libc, -lc) π«Ά
π¦ SYNOPSIS π¦
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <stdio.h>
int fcloseall(void);
that #define _GNU_SOURCE line is not optional, bestie β you need it, and the comment is literally pointing you at feature_test_macros(7) if you wanna know why π
π DESCRIPTION π
So. fcloseall() closes all of the calling process's open streams. Like, every stream that process has open. all of them. it's giving spring cleaning π§Ήβ¨
Buffered output for each stream gets written out before it's closed β same energy as fflush(3) β and buffered input just gets dropped on the floor. discarded. gone. bye π
and okay, here's the part that makes people gasp: the standard streams β stdin, stdout, and stderr β are also closed. yes, those ones. all three. π
π₯ RETURN VALUE π₯
0β slay, everything closed successfully πEOFβ on error, that's what you get π
π ATTRIBUTES π
For an explanation of the terms used in this section, see attributes(7). (yes, actually go look, it's right there β¨)
- Interface:
fcloseall() - Attribute: Thread safety
- Value:
MT-Unsafe race:streams
and the reason for that spicy value? fcloseall() does not lock the streams, so it is not thread-safe. no cap. if you're threading, this is a vibe check that you will fail π©
π STANDARDS π
GNU. π (it's a GNU thing, okay, it's not in the standard C lineup β iykyk)
π SEE ALSO π
close(2), fclose(3), fflush(3), fopen(3), setbuf(3)
and that's the whole page, bestie! π«Ά this little ditty came to you courtesy of Linux man-pages 6.20, dated 2026-02-08, and yes the filename at the end is literally fcloseall(3) again because manpages love a dramatic repetition. go close some streams. not your stdout tho. maybe. your call. π
β¨
π¦ where this page comes from
- 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 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2006, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms