]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fcloseall.3
user_namespaces.7: Minor rewordings of recently added text
[thirdparty/man-pages.git] / man3 / fcloseall.3
CommitLineData
c11b1abf 1.\" Copyright (c) 2006 by Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
c1cf42a5
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
fea681da 7.\"
c1cf42a5
MK
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
fea681da 12.\"
c1cf42a5
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
10d76543
MK
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da 24.\"
4b8c67d9 25.TH FCLOSEALL 3 2017-09-15 "GNU" "Linux Programmer's Manual"
fea681da
MK
26.SH NAME
27fcloseall \- close all open streams
28.SH SYNOPSIS
d5d687b1 29.nf
b80f966b 30.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
fea681da 31.B #include <stdio.h>
68e4db0a 32.PP
fea681da 33.B int fcloseall(void);
d5d687b1 34.fi
fea681da
MK
35.SH DESCRIPTION
36The
e511ffb6 37.BR fcloseall ()
c1cf42a5
MK
38function closes all of the calling process's open streams.
39Buffered output for each stream is written before it is closed
40(as for
41.BR fflush (3));
42buffered input is discarded.
847e0d88 43.PP
c1cf42a5
MK
44The standard streams,
45.IR stdin ,
46.IR stdout ,
47and
0daa9e92 48.I stderr
c1cf42a5 49are also closed.
47297adb 50.SH RETURN VALUE
c1cf42a5 51This function returns 0 if all files were successfully closed;
c13182ef
MK
52on error,
53.B EOF
c1cf42a5 54is returned.
f4d7c22b 55.SH ATTRIBUTES
548c91cd
MK
56For an explanation of the terms used in this section, see
57.BR attributes (7).
58.TS
59allbox;
60lb lb lb
61l l l.
62Interface Attribute Value
63T{
64.BR fcloseall ()
72c3922a 65T} Thread safety MT-Unsafe race:streams
548c91cd
MK
66.TE
67.PP
f4d7c22b
PH
68The
69.BR fcloseall ()
70function does not lock the streams, so it is not thread-safe.
47297adb 71.SH CONFORMING TO
c1cf42a5 72This function is a GNU extension.
47297adb 73.SH SEE ALSO
fea681da
MK
74.BR close (2),
75.BR fclose (3),
76.BR fflush (3),
77.BR fopen (3),
0a4f8b7b 78.BR setbuf (3)