xref: /illumos-gate/usr/src/man/man3c/fcloseall.3c (revision ed093b41a93e8563e6e1e5dae0768dda2a7bcc27)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright (c) 2014, Joyent, Inc.
13.\"
14.Dd "Dec 20, 2014"
15.Dt FCLOSEALL 3C
16.Os
17.Sh NAME
18.Nm fcloseall
19.Nd close all standard I/O streams
20.Sh SYNOPSIS
21.In stdio.h
22.Ft int
23.Fo fcloseall
24.Fa void
25.Fc
26.Sh DESCRIPTION
27The
28.Fn fcloseall
29function closes all open standard I/O streams.
30The equivalent of
31.Xr fflush 3C
32is called on each stream before closing, thus any buffered or pending
33input is discarded while any buffered or pending output is written out
34to the underlying file.
35This includes the standard streams,
36.Vt stdin ,
37.Vt stdout ,
38and
39.Vt stderr .
40.Sh RETURN VALUES
41Currently, the function
42.Fn fcloseall
43always returns
44.Sy 0 .
45Note, portable applications should always check the return value.
46.Sh INTERFACE STABILITY
47.Sy Committed .
48.Sh MT-LEVEL
49.Sy Mt-Safe .
50.Sh SEE ALSO
51.Xr close 2 ,
52.Xr fflush 3C ,
53.Xr attributes 7 ,
54.Xr environ 7 ,
55.Xr standards 7
56