Annotated edit history of
fclose(3) version 1, including all changes.
View license author blame.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
FCLOSE |
| |
|
2 |
!!!FCLOSE |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
RETURN VALUE |
| |
|
7 |
ERRORS |
| |
|
8 |
NOTES |
| |
|
9 |
CONFORMING TO |
| |
|
10 |
SEE ALSO |
| |
|
11 |
---- |
| |
|
12 |
!!NAME |
| |
|
13 |
|
| |
|
14 |
|
| |
|
15 |
fclose - close a stream |
| |
|
16 |
!!SYNOPSIS |
| |
|
17 |
|
| |
|
18 |
|
| |
|
19 |
__#include __ |
| |
|
20 |
|
| |
|
21 |
|
| |
|
22 |
__int fclose( FILE *__''stream''__);__ |
| |
|
23 |
!!DESCRIPTION |
| |
|
24 |
|
| |
|
25 |
|
| |
|
26 |
The __fclose__ function dissociates the named |
| |
|
27 |
''stream'' from its underlying file or set of functions. |
| |
|
28 |
If the stream was being used for output, any buffered data |
| |
|
29 |
is written first, using fflush(3). |
| |
|
30 |
!!RETURN VALUE |
| |
|
31 |
|
| |
|
32 |
|
| |
|
33 |
Upon successful completion 0 is returned. Otherwise, |
| |
|
34 |
__EOF__ is returned and the global variable ''errno'' |
| |
|
35 |
is set to indicate the error. In either case any further |
| |
|
36 |
access (including another call to __fclose__()) to the |
| |
|
37 |
stream results in undefined behaviour. |
| |
|
38 |
!!ERRORS |
| |
|
39 |
|
| |
|
40 |
|
| |
|
41 |
__EBADF__ |
| |
|
42 |
|
| |
|
43 |
|
| |
|
44 |
The filedescriptor underlying ''stream'' is not |
| |
|
45 |
valid. |
| |
|
46 |
|
| |
|
47 |
|
| |
|
48 |
The __fclose__ function may also fail and set |
| |
|
49 |
''errno'' for any of the errors specified for the |
| |
|
50 |
routines close(2), write(2) or |
| |
|
51 |
fflush(3). |
| |
|
52 |
!!NOTES |
| |
|
53 |
|
| |
|
54 |
|
| |
|
55 |
Note that __fclose__ only flushes the user space buffers |
| |
|
56 |
provided by the C library. To ensure that the data is |
| |
|
57 |
physically stored on disk the kernel buffers must be flushed |
| |
|
58 |
too, e.g. with sync(2) or |
| |
|
59 |
fsync(2). |
| |
|
60 |
!!CONFORMING TO |
| |
|
61 |
|
| |
|
62 |
|
| |
|
63 |
The __fclose__ function conforms to ANSI X3.159-1989 |
| |
|
64 |
(``ANSI C''). |
| |
|
65 |
!!SEE ALSO |
| |
|
66 |
|
| |
|
67 |
|
| |
|
68 |
close(2), fcloseall(3), fflush(3), |
| |
|
69 |
fopen(3), setbuf(3) |
| |
|
70 |
---- |
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.