fflush(3C) — COMPATIBILITY FUNCTIONS
NAME
fflush − close or flush a stream
SYNOPSIS
#include <stdio.h>
int fflush(FILE ∗stream);
DESCRIPTION
If stream points to an output stream or an update stream on which the most recent operation was not input, fflush() causes any buffered data waiting to be written for the named stream to be written to that file. Any unread data buffered in stream is discarded. The stream remains open. If stream is open for reading, the underlying file pointer is not already at end of file, and the file is one capable of seeking, the file pointer is adjusted so that the next operation on the open file pointer deals with the byte after the last one read from or written to the stream.
When calling fflush(), if stream is a null pointer, all files open for writing are flushed.
RETURN VALUES
Upon successful completion these functions return a value of zero. Otherwise EOF is returned.
SEE ALSO
close(2V), exit(2V), intro(3), fopen(3V), setbuf(3V), stdio(3V), fclose(3V)
NOTES
The unbundled ANSI C compiler provides ANSI versions of most of the system header files, which are used automatically at compile time. For example, the directive
#include <stdio.h> will use the file provided by this compiler, rather than /usr/include/stdio.h.
Sun Release 4.1 — Last change: 21 June 1994