Commit | Line | Data |
---|---|---|
89100a81 | 1 | .\" @(#)fclose.3 6.1 (Berkeley) %G% |
22f1f128 | 2 | .\" |
89100a81 | 3 | .TH FCLOSE 3S "" |
22f1f128 KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | fclose, 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 | |
23 | causes any buffers for the named | |
24 | .I stream | |
25 | to be emptied, and the file to be closed. | |
26 | Buffers allocated by the standard input/output system | |
27 | are freed. | |
28 | .PP | |
29 | .I Fclose | |
30 | is performed automatically upon | |
31 | calling | |
e5164e6c | 32 | .IR exit (3). |
22f1f128 KM |
33 | .PP |
34 | .I Fflush | |
35 | causes any buffered data for the named output | |
36 | .I stream | |
37 | to be written to that file. | |
38 | The stream remains open. | |
39 | .SH "SEE ALSO" | |
40 | close(2), | |
e5164e6c KM |
41 | fopen(3S), |
42 | setbuf(3S) | |
22f1f128 KM |
43 | .SH DIAGNOSTICS |
44 | These routines return | |
45 | .SM | |
46 | .B EOF | |
47 | if | |
48 | .I stream | |
49 | is not associated with an output file, or | |
50 | if buffered data cannot be transferred to that file. |