Merge commit 'b31ca922c7346747131aed07c0c171ec2f573aac' into merges
[unleashed.git] / share / man / man3c / fcloseall.3c
blobbd13dc76a69999de39fd632fa57513336e84fea7
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
27 The
28 .Fn fcloseall
29 function closes all open standard I/O streams.
30 The equivalent of
31 .Xr fflush 3C
32 is called on each stream before closing, thus any buffered or pending
33 input is discarded while any buffered or pending output is written out
34 to the underlying file.
35 This includes the standard streams,
36 .Vt stdin ,
37 .Vt stdout ,
38 and
39 .Vt stderr .
40 .Sh RETURN VALUES
41 Currently, the function
42 .Fn fcloseall
43 always returns
44 .Sy 0 .
45 Note, 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 5 ,
54 .Xr environ 5 ,
55 .Xr standards 5