document sticky EOF
[unix-history] / usr / src / lib / libc / stdio / fclose.3
CommitLineData
89100a81 1.\" @(#)fclose.3 6.1 (Berkeley) %G%
22f1f128 2.\"
89100a81 3.TH FCLOSE 3S ""
22f1f128
KM
4.AT 3
5.SH NAME
6fclose, fflush \- close or flush a stream
7.SH SYNOPSIS
8.B #include <stdio.h>
9.PP
10.B fclose(stream)
11.br
12.SM
13.B FILE
14.B *stream;
15.PP
16.B fflush(stream)
17.br
18.SM
19.B FILE
20.B *stream;
21.SH DESCRIPTION
22.I Fclose
23causes any buffers for the named
24.I stream
25to be emptied, and the file to be closed.
26Buffers allocated by the standard input/output system
27are freed.
28.PP
29.I Fclose
30is performed automatically upon
31calling
e5164e6c 32.IR exit (3).
22f1f128
KM
33.PP
34.I Fflush
35causes any buffered data for the named output
36.I stream
37to be written to that file.
38The stream remains open.
39.SH "SEE ALSO"
40close(2),
e5164e6c
KM
41fopen(3S),
42setbuf(3S)
22f1f128
KM
43.SH DIAGNOSTICS
44These routines return
45.SM
46.B EOF
47if
48.I stream
49is not associated with an output file, or
50if buffered data cannot be transferred to that file.