.\" Copyright (c) 1990 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)stdio.3 6.3 (Berkeley) %G%
stdio \- standard buffered input/output package
The functions described here constitute a user-level buffering scheme.
handle characters quickly.
The higher level routines in
they can be freely intermixed.
A file with associated buffering is called a
and is declared to be a pointer to a defined type
create certain descriptive data for a stream
and return a pointer to designate the stream in all further transactions.
There are three normally open streams with constant pointers declared in
the include file and associated with the standard open files:
designates no stream at all.
(\-1) is returned upon end of file or error by integer functions that
Any routine that uses the standard input/output package
must include the header file
The constants and functions listed here
are declared in the include file and need no further declaration.
The following are implemented as macros;
these names may not be reused
without first removing their current definitions with
Function versions of the macro functions
exist and will be used if the macros definitions are explicitly removed.
Output streams that refer to terminal devices
are always line buffered by default;
pending output to such streams is written automatically
whenever an input stream that refers to a terminal device is read.
In cases where a large amount of computation is done after printing
part of a line on an output terminal, it is necessary to
the standard output before going off and computing so that the output
open(2), close(2), read(2), write(2)
all of the manuals listed below
is returned uniformly to indicate that a
pointer has not been initialized with
input (output) has been attempted on an output (input) stream, or a
pointer designates corrupt or otherwise unintelligible
The standard buffered functions do not interact well with certain other
library and system functions, especially \fIvfork\fP and \fIabort\fP.
.ta \w'setlinebuf'u+2n +\w'setvbuf.3'u+10n
\fIName\fP \fIAppears on Page\fP \fIDescription\fP
.ta \w'setlinebuf'u+4n +\w'setvbuf.3'u+4n
clearerr ferror.3 stream status inquiries
fclose fclose.3 close a stream
fdopen fopen.3 open a stream
feof ferror.3 stream status inquiries
ferror ferror.3 stream status inquiries
fflush fflush.3 flush a stream
fgetc getc.3 get a character or word from a stream
fgetline fgetline.3 get a line from a stream
fgetpos fseek.3 reposition a stream
fgets fgets.3 get a line from a stream
fileno ferror.3 stream status inquiries
fmemopen fmemopen.3 open a block of memory as a stream
fopen fopen.3 open a stream
fprintf printf.3 formatted output conversion
fpurge fpurge.3 discard buffered stream data
fputc putc.3 put a character or word to a stream
fputs fputs.3 put a line to a stream
fread fread.3 stream binary input/output
freopen fopen.3 open a stream
fscanf scanf.3 formatted input conversion
fseek fseek.3 reposition a stream
fsetpos fseek.3 reposition a stream
ftell fseek.3 reposition a stream
funopen fopen.3 open a stream
fwrite fread.3 stream binary input/output
getc getc.3 get a character or word from a stream
getchar getc.3 get a character or word from a stream
gets fgets.3 get a line from a stream
getw getc.3 get a character or word from a stream
printf printf.3 formatted output conversion
putc putc.3 put a character or word to a stream
putchar putc.3 put a character or word to a stream
puts fputs.3 put a line to a stream
putw putc.3 put a character or word to a stream
remove remove.3 remove a file xxx
rewind fseek.3 reposition a stream
scanf scanf.3 formatted input conversion
setbuf setvbuf.3 assign buffering to a stream
setbuffer setvbuf.3 assign buffering to a stream
setlinebuf setvbuf.3 assign buffering to a stream
setvbuf setvbuf.3 assign buffering to a stream
.\" smprintf printf.3 formatted output conversion
snprintf printf.3 formatted output conversion
sprintf printf.3 formatted output conversion
ungetc ungetc.3 push character back into input stream
vfprintf printf.3 formatted output conversion
vprintf printf.3 formatted output conversion
.\" vsmprintf printf.3 formatted output conversion
vsnprintf printf.3 formatted output conversion
vsprintf printf.3 formatted output conversion
Although these have nothing to do with `standard I/O',
the following declarations also appear in
as required by ANSI X3.159-1989 and IEEE 1003.2 standards:
.ta \w'setlinebuf'u+2n +\w'setvbuf.3'u+10n
\fIName\fP \fIAppears on Page\fP \fIDescription\fP
.ta \w'setlinebuf'u+4n +\w'setvbuf.3'u+4n
getlogin getlogin.3 get login name
pclose popen.3 initiate I/O to/from a process
popen popen.3 initiate I/O to/from a process