Debian Codegraph @

upstream/debian-trixie/man3/fcloseall.3

raw
1 '\" t
2 .\" Copyright (c) 2006 by Michael Kerrisk <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH fcloseall 3 2024-05-02 "Linux man-pages 6.9.1"
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 .P
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 .P
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 .TS
43 allbox;
44 lbx lb lb
45 l l l.
46 Interface Attribute Value
47 T{
48 .na
49 .nh
50 .BR fcloseall ()
51 T} Thread safety MT-Unsafe race:streams
52 .TE
53 .P
54 The
55 .BR fcloseall ()
56 function does not lock the streams, so it is not thread-safe.
57 .SH STANDARDS
58 GNU.
59 .SH SEE ALSO
60 .BR close (2),
61 .BR fclose (3),
62 .BR fflush (3),
63 .BR fopen (3),
64 .BR setbuf (3)