1FCLOSEALL(3) Linux Programmer's Manual FCLOSEALL(3)
2
3
4
6 fcloseall - close all open streams
7
9 #define _GNU_SOURCE /* See feature_test_macros(7) */
10 #include <stdio.h>
11
12 int fcloseall(void);
13
15 The fcloseall() function closes all of the calling process's open
16 streams. Buffered output for each stream is written before it is
17 closed (as for fflush(3)); buffered input is discarded.
18
19 The standard streams, stdin, stdout, and stderr are also closed.
20
22 This function returns 0 if all files were successfully closed; on er‐
23 ror, EOF is returned.
24
26 For an explanation of the terms used in this section, see at‐
27 tributes(7).
28
29 ┌─────────────────────────────┬───────────────┬────────────────────────┐
30 │Interface │ Attribute │ Value │
31 ├─────────────────────────────┼───────────────┼────────────────────────┤
32 │fcloseall() │ Thread safety │ MT-Unsafe race:streams │
33 └─────────────────────────────┴───────────────┴────────────────────────┘
34
35 The fcloseall() function does not lock the streams, so it is not
36 thread-safe.
37
39 This function is a GNU extension.
40
42 close(2), fclose(3), fflush(3), fopen(3), setbuf(3)
43
45 This page is part of release 5.12 of the Linux man-pages project. A
46 description of the project, information about reporting bugs, and the
47 latest version of this page, can be found at
48 https://www.kernel.org/doc/man-pages/.
49
50
51
52GNU 2021-03-22 FCLOSEALL(3)