4.4BSD/usr/share/man/cat3/fclose.0
FCLOSE(3) BSD Programmer's Manual FCLOSE(3)
NNAAMMEE
ffcclloossee - close a stream
SSYYNNOOPPSSIISS
##iinncclluuddee <<ssttddiioo..hh>>
_i_n_t
ffcclloossee(_F_I_L_E _*_s_t_r_e_a_m);
DDEESSCCRRIIPPTTIIOONN
The ffcclloossee() function dissociates the named _s_t_r_e_a_m 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).
RREETTUURRNN VVAALLUUEESS
Upon successful completion 0 is returned. Otherwise, EOF is returned and
the global variable _e_r_r_n_o is set to indicate the error. In either case
no further access to the stream is possible.
EERRRROORRSS
[EBADF] The argument _s_t_r_e_a_m is not an open stream.
The ffcclloossee() function may also fail and set _e_r_r_n_o for any of the errors
specified for the routines close(2) or fflush(3).
SSEEEE AALLSSOO
close(2), fflush(3), fopen(3), setbuf(3)
SSTTAANNDDAARRDDSS
The ffcclloossee() function conforms to ANSI C X3.159-1989 (``ANSI C '').
4.4BSD June 4, 1993 1