1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)stdio.3s 6.2 (Berkeley) 5/13/86
7 .TH STDIO 3 "May 13, 1986"
10 stdio \- standard buffered input/output package
22 The functions in the standard I/O library constitute a user-level buffering
23 scheme. The in-line macros
27 handle characters quickly. The higher level routines
42 they can be freely intermixed.
44 A file with associated buffering is called a
46 and is declared to be a pointer to a defined type
50 creates certain descriptive data for a stream
51 and returns a pointer to designate the stream in all further transactions.
52 There are three normally open streams with constant pointers declared in
53 the include file and associated with the standard open files:
72 designates no stream at all.
77 (\-1) is returned upon end of file or error by integer functions that
80 Any routine that uses the standard input/output package
81 must include the header file
83 of pertinent macro definitions.
84 The functions and constants mentioned in the standard I/O manual pages
85 are declared in the include file and need no further declaration.
86 The constants, and the following `functions' are
87 implemented as macros; redeclaration of these names is perilous:
118 is returned uniformly to indicate that a
121 pointer has not been initialized with
123 input (output) has been attempted on an output (input) stream, or a
126 pointer designates corrupt or otherwise unintelligible
131 For purposes of efficiency, this implementation of the standard library
132 has been changed to line buffer output to a terminal by default and attempts
133 to do this transparently by flushing the output whenever a
135 from the standard input is necessary. This is almost always transparent,
136 but may cause confusion or malfunctioning of programs which use
137 standard i/o routines but use
139 themselves to read from the standard input.
141 In cases where a large amount of computation is done after printing
142 part of a line on an output terminal, it is necessary to
144 the standard output before going off and computing so that the output
147 The standard buffered functions do not interact well with certain other
148 library and system functions, especially \fBfork\fP and \fBabort\fP.
149 .SH "LIST OF FUNCTIONS"
152 .ta \w'setlinebuf'u+2n +\w'setbuf(3)'u+10n
153 \fBName\fP \fBAppears on Page\fP \fBDescription\fP
154 .ta \w'setlinebuf'u+4n +\w'setbuf(3)'u+4n
156 clearerr ferror(3) stream status inquiries
157 fclose fclose(3) close or flush a stream
158 fdopen fopen(3) open a stream
159 feof ferror(3) stream status inquiries
160 ferror ferror(3) stream status inquiries
161 fflush fclose(3) close or flush a stream
162 fgetc getc(3) get character or word from stream
163 fgets gets(3) get a string from a stream
164 fileno ferror(3) stream status inquiries
165 fopen fopen(3) open a stream
166 fprintf printf(3) formatted output conversion
167 fputc putc(3) put character or word on a stream
168 fputs puts(3) put a string on a stream
169 fread fread(3) buffered binary input/output
170 freopen fopen(3) open a stream
171 fscanf scanf(3) formatted input conversion
172 fseek fseek(3) reposition a stream
173 ftell fseek(3) reposition a stream
174 fwrite fread(3) buffered binary input/output
175 getc getc(3) get character or word from stream
176 getchar getc(3) get character or word from stream
177 gets gets(3) get a string from a stream
178 getw getc(3) get character or word from stream
179 printf printf(3) formatted output conversion
180 putc putc(3) put character or word on a stream
181 putchar putc(3) put character or word on a stream
182 puts puts(3) put a string on a stream
183 putw putc(3) put character or word on a stream
184 rewind fseek(3) reposition a stream
185 scanf scanf(3) formatted input conversion
186 setbuf setbuf(3) assign buffering to a stream
187 setvbuf setbuf(3) assign buffering to a stream
188 snprintf printf(3) formatted output conversion
189 sprintf printf(3) formatted output conversion
190 sscanf scanf(3) formatted input conversion
191 ungetc ungetc(3) push character back into input stream
192 vfprintf printf(3) formatted output conversion
193 vfscanf scanf(3) formatted input conversion
194 vprintf printf(3) formatted output conversion
195 vscanf scanf(3) formatted input conversion
196 vsnprintf printf(3) formatted output conversion
197 vsprintf printf(3) formatted output conversion
198 vsscanf scanf(3) formatted input conversion