OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / fcloseall.3
1 .\" Copyright (c) 2006 by Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
7 .\"
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.
12 .\"
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
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.
23 .\" %%%LICENSE_END
24 .\"
25 .TH FCLOSEALL 3  2013-06-21 "GNU" "Linux Programmer's Manual"
26 .SH NAME
27 fcloseall \- close all open streams
28 .SH SYNOPSIS
29 .nf
30 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
31 .B #include <stdio.h>
32 .sp
33 .B int fcloseall(void);
34 .fi
35 .SH DESCRIPTION
36 The
37 .BR fcloseall ()
38 function closes all of the calling process's open streams.
39 Buffered output for each stream is written before it is closed
40 (as for
41 .BR fflush (3));
42 buffered input is discarded.
43
44 The standard streams,
45 .IR stdin ,
46 .IR stdout ,
47 and
48 .I stderr
49 are also closed.
50 .SH RETURN VALUE
51 This function returns 0 if all files were successfully closed;
52 on error,
53 .B EOF
54 is returned.
55 .SH ATTRIBUTES
56 .SS Multithreading (see pthreads(7))
57 The
58 .BR fcloseall ()
59 function does not lock the streams, so it is not thread-safe.
60 .SH CONFORMING TO
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)
68 .SH COLOPHON
69 This page is part of release 3.68 of the Linux
70 .I man-pages
71 project.
72 A description of the project,
73 information about reporting bugs,
74 and the latest version of this page,
75 can be found at
76 \%http://www.kernel.org/doc/man\-pages/.