]>
Commit | Line | Data |
---|---|---|
c11b1abf | 1 | .\" Copyright (c) 2006 by Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 2 | .\" |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da | 4 | .\" |
45186a5d | 5 | .TH FCLOSEALL 3 2021-03-22 "Linux man-pages (unreleased)" |
fea681da MK |
6 | .SH NAME |
7 | fcloseall \- close all open streams | |
afa8db94 AC |
8 | .SH LIBRARY |
9 | Standard C library | |
10 | .RI ( libc ", " \-lc ) | |
fea681da | 11 | .SH SYNOPSIS |
d5d687b1 | 12 | .nf |
b80f966b | 13 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
fea681da | 14 | .B #include <stdio.h> |
68e4db0a | 15 | .PP |
fea681da | 16 | .B int fcloseall(void); |
d5d687b1 | 17 | .fi |
fea681da MK |
18 | .SH DESCRIPTION |
19 | The | |
e511ffb6 | 20 | .BR fcloseall () |
c1cf42a5 MK |
21 | function closes all of the calling process's open streams. |
22 | Buffered output for each stream is written before it is closed | |
23 | (as for | |
24 | .BR fflush (3)); | |
25 | buffered input is discarded. | |
847e0d88 | 26 | .PP |
c1cf42a5 MK |
27 | The standard streams, |
28 | .IR stdin , | |
29 | .IR stdout , | |
30 | and | |
0daa9e92 | 31 | .I stderr |
c1cf42a5 | 32 | are also closed. |
47297adb | 33 | .SH RETURN VALUE |
c1cf42a5 | 34 | This function returns 0 if all files were successfully closed; |
c13182ef MK |
35 | on error, |
36 | .B EOF | |
c1cf42a5 | 37 | is returned. |
f4d7c22b | 38 | .SH ATTRIBUTES |
548c91cd MK |
39 | For an explanation of the terms used in this section, see |
40 | .BR attributes (7). | |
c466875e MK |
41 | .ad l |
42 | .nh | |
548c91cd MK |
43 | .TS |
44 | allbox; | |
c466875e | 45 | lbx lb lb |
548c91cd MK |
46 | l l l. |
47 | Interface Attribute Value | |
48 | T{ | |
49 | .BR fcloseall () | |
72c3922a | 50 | T} Thread safety MT-Unsafe race:streams |
548c91cd | 51 | .TE |
c466875e MK |
52 | .hy |
53 | .ad | |
54 | .sp 1 | |
548c91cd | 55 | .PP |
f4d7c22b PH |
56 | The |
57 | .BR fcloseall () | |
58 | function does not lock the streams, so it is not thread-safe. | |
3113c7f3 | 59 | .SH STANDARDS |
c1cf42a5 | 60 | This function is a GNU extension. |
47297adb | 61 | .SH SEE ALSO |
fea681da MK |
62 | .BR close (2), |
63 | .BR fclose (3), | |
64 | .BR fflush (3), | |
65 | .BR fopen (3), | |
0a4f8b7b | 66 | .BR setbuf (3) |