fclose(), fflush(), fclose_unlocked(), fflush_unlocked() — close or flush a stream
int fclose(FILE *stream);
int fflush(FILE *stream);
int fclose_unlocked(FILE *stream);
int fflush_unlocked(FILE *stream);
causes any buffered data for the named
to be written out, and the
to be closed.
Buffers allocated by the standard input/output system may be freed.
is performed automatically for all open files upon calling
points to an output stream or an update stream in which the
most recent operation was output,
causes any buffered data for the
to be written to that file; otherwise any buffered data is discarded.
is a null pointer,
performs this flushing action on all currently open streams.
close or flush a stream.
Upon successful completion,
return EOF and set
to indicate the error.
is set to one of:
flag is set for the file descriptor underlying
and the process would be delayed in the write operation.
The file descriptor underlying
is not valid.
An attempt was made to write a file
that exceeds the process's file size limit
or the maximum file size (see
was interrupted by a signal.
The process is in a background process group
and is attempting to write to its controlling terminal,
is set, the process is neither ignoring nor blocking the
signal, and the process group of the process is orphaned.
There was no free space remaining on the device containing the file.
An attempt was made to write to a pipe
that is not open for reading by any process.
signal is also sent to the process.
values may be set by the underlying
are obsolescent interfaces supported only for compatibility
with existing DCE applications.
New multithreaded applications should use
fclose(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
fflush(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C