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