| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: stdio.3,v 1.27 2018/02/22 08:33:43 pgoyette Exp $ | | 1 | .\" $NetBSD: stdio.3,v 1.28 2020/08/29 15:25:57 rillig Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991, 1993 | | 3 | .\" Copyright (c) 1990, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" 3. Neither the name of the University nor the names of its contributors | | 14 | .\" 3. Neither the name of the University nor the names of its contributors |
| @@ -19,27 +19,27 @@ | | | @@ -19,27 +19,27 @@ |
19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 | .\" SUCH DAMAGE. | | 28 | .\" SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .\" @(#)stdio.3 8.7 (Berkeley) 4/19/94 | | 30 | .\" @(#)stdio.3 8.7 (Berkeley) 4/19/94 |
31 | .\" | | 31 | .\" |
32 | .Dd February 22, 2018 | | 32 | .Dd August 29, 2020 |
33 | .Dt STDIO 3 | | 33 | .Dt STDIO 3 |
34 | .Os | | 34 | .Os |
35 | .Sh NAME | | 35 | .Sh NAME |
36 | .Nm stdio | | 36 | .Nm stdio |
37 | .Nd standard input/output library functions | | 37 | .Nd standard input/output library functions |
38 | .Sh LIBRARY | | 38 | .Sh LIBRARY |
39 | .Lb libc | | 39 | .Lb libc |
40 | .Sh SYNOPSIS | | 40 | .Sh SYNOPSIS |
41 | .In stdio.h | | 41 | .In stdio.h |
42 | .Vt FILE *stdin; | | 42 | .Vt FILE *stdin; |
43 | .Vt FILE *stdout; | | 43 | .Vt FILE *stdout; |
44 | .Vt FILE *stderr; | | 44 | .Vt FILE *stderr; |
45 | .Sh DESCRIPTION | | 45 | .Sh DESCRIPTION |
| @@ -53,35 +53,33 @@ and the physical | | | @@ -53,35 +53,33 @@ and the physical |
53 | .Tn I/O | | 53 | .Tn I/O |
54 | characteristics are concealed. | | 54 | characteristics are concealed. |
55 | .Pp | | 55 | .Pp |
56 | A stream is associated with an external file (which may be a physical | | 56 | A stream is associated with an external file (which may be a physical |
57 | device) by | | 57 | device) by |
58 | .Em opening | | 58 | .Em opening |
59 | a file, which may involve creating a new file. | | 59 | a file, which may involve creating a new file. |
60 | Creating an existing file causes its former contents to be discarded. | | 60 | Creating an existing file causes its former contents to be discarded. |
61 | If a file can support positioning requests (such as a disk file, as opposed | | 61 | If a file can support positioning requests (such as a disk file, as opposed |
62 | to a terminal) then a | | 62 | to a terminal) then a |
63 | .Em file position indicator | | 63 | .Em file position indicator |
64 | associated with the stream is positioned at the start of the file (byte | | 64 | associated with the stream is positioned at the start of the file (byte |
65 | zero), unless the file is opened with append mode. | | 65 | zero), unless the file is opened with append mode. |
66 | If append mode | | 66 | If append mode is used, the position indicator is placed at the end-of-file. |
67 | is used, the position indicator will be placed the end-of-file. | | | |
68 | The position indicator is maintained by subsequent reads, writes | | 67 | The position indicator is maintained by subsequent reads, writes |
69 | and positioning requests. | | 68 | and positioning requests. |
70 | All input occurs as if the characters | | 69 | All input occurs as if the characters were read by successive calls to the |
71 | were read by successive calls to the | | | |
72 | .Xr fgetc 3 | | 70 | .Xr fgetc 3 |
73 | function; all output takes place as if all characters were | | 71 | function; all output takes place as if all characters were |
74 | read by successive calls to the | | 72 | written by successive calls to the |
75 | .Xr fputc 3 | | 73 | .Xr fputc 3 |
76 | function. | | 74 | function. |
77 | .Pp | | 75 | .Pp |
78 | A file is disassociated from a stream by | | 76 | A file is disassociated from a stream by |
79 | .Em closing | | 77 | .Em closing |
80 | the file. | | 78 | the file. |
81 | Output streams are flushed (any unwritten buffer contents are transferred | | 79 | Output streams are flushed (any unwritten buffer contents are transferred |
82 | to the host environment) before the stream is disassociated from the file. | | 80 | to the host environment) before the stream is disassociated from the file. |
83 | The value of a pointer to a | | 81 | The value of a pointer to a |
84 | .Dv FILE | | 82 | .Dv FILE |
85 | object is indeterminate after a file is closed (garbage). | | 83 | object is indeterminate after a file is closed (garbage). |
86 | .Pp | | 84 | .Pp |
87 | A file may be subsequently reopened, by the same or another program | | 85 | A file may be subsequently reopened, by the same or another program |