NAME

ferror, feof, clearerr, fileno - stream status inquires

SYNOPSIS

#include <stdio_p.h>

int feof(stream)
FILE *stream;

int ferror(stream)
FILE *stream;

clearerr(stream)
FILE *stream;

fileno(stream)
FILE *stream;

DESCRIPTION

feof returns non-zero when end of file is read on the named input stream, otherwise zero.

ferror returns non-zero when error has occured reading or writing the named stream, otherwise zero. Unless cleared by clearerr, the error indication lasts until the stream is closed.

clearerr resets the error indication on the named stream. fileno returns the integer file descriptor (type FD) associated with the stream, see open(2P). feof, ferror, and fileno are implemented as macros; they cannot be re-declared.

SEE ALSO

open(2F) , fopen(3P).