Revision 88d0a458d499c9e60b972448de42f2b9acf6453b authored by Ken Thompson on 06 November 1973, 00:41:35 UTC, committed by Ken Thompson on 06 November 1973, 00:41:35 UTC
Work on file man/man2/break.2 Work on file man/man2/chdir.2 Work on file man/man2/chmod.2 Work on file man/man2/chown.2 Work on file man/man2/close.2 Work on file man/man2/csw.2 Work on file man/man2/dup.2 Work on file man/man2/exit.2 Work on file man/man2/fork.2 Work on file man/man2/fstat.2 Work on file man/man2/getgid.2 Work on file man/man2/getuid.2 Work on file man/man2/indir.2 Work on file man/man2/kill.2 Work on file man/man2/link.2 Work on file man/man2/mount.2 Work on file man/man2/open.2 Work on file man/man2/pipe.2 Work on file man/man2/read.2 Work on file man/man2/seek.2 Work on file man/man2/sleep.2 Work on file man/man2/stat.2 Work on file man/man2/stime.2 Work on file man/man2/stty.2 Co-Authored-By: Dennis Ritchie <dmr@research.uucp> Synthesized-from: v4
1 parent 89372e2
putchr.3
.th PUTCHAR III 5/10/73
.sh NAME
putchar \*- write character
.sh SYNOPSIS
.ft B
putchar(ch)
.s3
flush( )
.ft R
.sh DESCRIPTION
.it Putchar
writes out its argument and returns it unchanged.
The low-order byte of the
argument is always written;
the high-order byte is written only if it is
non-null.
Unless other arrangements have been made,
.it putchar
writes in
unbuffered fashion on the standard output file.
.s3
Associated with this routine is an external variable
.it fout
which has the
structure of a buffer discussed under putc (III).
If the file descriptor part of this structure (first word)
is not 1, output via
.it putchar
is buffered.
To achieve buffered output one may say, for example,
.s3
.nf
fout = dup(1); or
fout = fcreat(...);
.s3
.fi
In such a case
.it flush
must be called
before the program terminates in order to flush out
the buffered output.
.it Flush
may be called at any time.
.sh "SEE ALSO"
putc(III)
.sh BUGS
The
.it fout
notion is kludgy.
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...