1fcloseall(3) Library Functions Manual fcloseall(3)
2
3
4
6 fcloseall - close all open streams
7
9 Standard C library (libc, -lc)
10
12 #define _GNU_SOURCE /* See feature_test_macros(7) */
13 #include <stdio.h>
14
15 int fcloseall(void);
16
18 The fcloseall() function closes all of the calling process's open
19 streams. Buffered output for each stream is written before it is
20 closed (as for fflush(3)); buffered input is discarded.
21
22 The standard streams, stdin, stdout, and stderr are also closed.
23
25 This function returns 0 if all files were successfully closed; on er‐
26 ror, EOF is returned.
27
29 For an explanation of the terms used in this section, see at‐
30 tributes(7).
31
32 ┌─────────────────────────────┬───────────────┬────────────────────────┐
33 │Interface │ Attribute │ Value │
34 ├─────────────────────────────┼───────────────┼────────────────────────┤
35 │fcloseall() │ Thread safety │ MT-Unsafe race:streams │
36 └─────────────────────────────┴───────────────┴────────────────────────┘
37
38 The fcloseall() function does not lock the streams, so it is not
39 thread-safe.
40
42 GNU.
43
45 close(2), fclose(3), fflush(3), fopen(3), setbuf(3)
46
47
48
49Linux man-pages 6.04 2023-03-30 fcloseall(3)