BSD 4_4 development
[unix-history] / usr / share / man / cat3 / fpurge.0
FFLUSH(3) BSD Programmer's Manual FFLUSH(3)
N\bNA\bAM\bME\bE
f\bff\bfl\blu\bus\bsh\bh, f\bfp\bpu\bur\brg\bge\be - flush a stream
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bst\btd\bdi\bio\bo.\b.h\bh>\b>
_\bi_\bn_\bt
f\bff\bfl\blu\bus\bsh\bh(_\bF_\bI_\bL_\bE _\b*_\bs_\bt_\br_\be_\ba_\bm);
_\bi_\bn_\bt
f\bfp\bpu\bur\brg\bge\be(_\bF_\bI_\bL_\bE _\b*_\bs_\bt_\br_\be_\ba_\bm);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The function f\bff\bfl\blu\bus\bsh\bh() forces a write of all buffered data for the given
output or update _\bs_\bt_\br_\be_\ba_\bm via the stream's underlying write function. The
open status of the stream is unaffected.
If the _\bs_\bt_\br_\be_\ba_\bm argument is NULL, f\bff\bfl\blu\bus\bsh\bh() flushes _\ba_\bl_\bl open output streams.
The function f\bfp\bpu\bur\brg\bge\be() erases any input or output buffered in the given
_\bs_\bt_\br_\be_\ba_\bm. For output streams this discards any unwritten output. For input
streams this discards any input read from the underlying object but not
yet obtained via getc(3); this includes any text pushed back via ungetc.
R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bES\bS
Upon successful completion 0 is returned. Otherwise, EOF is returned and
the global variable _\be_\br_\br_\bn_\bo is set to indicate the error.
E\bER\bRR\bRO\bOR\bRS\bS
[EBADF] _\bS_\bt_\br_\be_\ba_\bm is not an open stream, or, in the case of f\bff\bfl\blu\bus\bsh\bh(), not a
stream open for writing.
The function f\bff\bfl\blu\bus\bsh\bh() may also fail and set _\be_\br_\br_\bn_\bo for any of the errors
specified for the routine write(2).
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
write(2), fopen(3), fclose(3), setbuf(3)
S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
The f\bff\bfl\blu\bus\bsh\bh() function conforms to ANSI C X3.159-1989 (``ANSI C '').
4.4BSD June 4, 1993 1