fflush()

flush stream 

Function


SYNOPSIS

#include <stdio.h>

int fflush(FILE *stream);


DESCRIPTION

The fflush() function causes any buffered output data for stream to be written to file. If any data is written, the file's associated st_mtime and st_ctime values are marked for update. The stream remains open.

If stream is a null pointer when calling fflush(), all streams opened for writing or update are flushed.


PARAMETERS

stream 

This parameter is either a null pointer or is a pointer to a stream opened for writing or update.


RETURN VALUES

If successful, the fflush() function returns a value of zero. On failure, it returns EOF and sets errno as follows:

EACCES 

Another process has the file locked.

EBADF 

stream is not a valid stream opened for writing.

EFBIG 

The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.

EINTR 

A signal interrupted the call.

EIO 

An output error occurred.

ENOMEM 

Memory could not be allocated for internal buffers.

ENOSPC 

An attempt is made to write to a full disk.

ENXIO 

A device error occurred.

EPIPE 

A write to a closed pipe was attempted.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

Some varieties of UNIX allow fflush() on an input stream.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
fclose(), fopen(), fpurge()


PTC MKS Toolkit 10.1 Documentation Build 15.