BSD 4_4 development
[unix-history] / usr / share / man / cat3 / fclose.0
FCLOSE(3) BSD Programmer's Manual FCLOSE(3)
N\bNA\bAM\bME\bE
f\bfc\bcl\blo\bos\bse\be - close 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\bfc\bcl\blo\bos\bse\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 f\bfc\bcl\blo\bos\bse\be() function dissociates the named _\bs_\bt_\br_\be_\ba_\bm from its underlying
file or set of functions. If the stream was being used for output, any
buffered data is written first, using fflush(3).
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. In either case
no further access to the stream is possible.
E\bER\bRR\bRO\bOR\bRS\bS
[EBADF] The argument _\bs_\bt_\br_\be_\ba_\bm is not an open stream.
The f\bfc\bcl\blo\bos\bse\be() function may also fail and set _\be_\br_\br_\bn_\bo for any of the errors
specified for the routines close(2) or fflush(3).
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
close(2), fflush(3), fopen(3), setbuf(3)
S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
The f\bfc\bcl\blo\bos\bse\be() function conforms to ANSI C X3.159-1989 (``ANSI C '').
4.4BSD June 4, 1993 1