FEOF(3s,L) AIX Technical Reference FEOF(3s,L)
-------------------------------------------------------------------------------
feof, ferror, clearerr, fileno
PURPOSE
Checks the status of a stream.
LIBRARY
Standard I/O Library (libc.a)
SYNTAX
#include <stdio.h>
int feof (stream) void clearerr (stream)
FILE *stream; FILE *stream;
int ferror (stream) int fileno (stream)
FILE *stream; FILE *stream;
DESCRIPTION
These macros inquire about the status of a stream. Each of these macros also
can be found in libc.a as subroutines.
The feof macro inquires about end-of-file. If EOF has previously been detected
reading the input stream specified by the stream parameter, a nonzero value is
returned. Otherwise, a value of 0 is returned.
The ferror macro inquires about input/output errors. If an I/O error has
previously occurred when reading from or writing to the stream specified by the
stream parameter, a nonzero value is returned. Otherwise, a value of 0 is
returned.
The clearerr macro resets the error indicator and the EOF indicator to 0 for
the stream specified by the stream parameter.
The fileno macro returns the integer file descriptor associated with the input
pointed to by the stream parameter.
Note: Since these routines are implemented as macros, they cannot be declared
or redeclared without first undefining the macro (after including
stdio.h).
Processed November 7, 1990 FEOF(3s,L) 1
FEOF(3s,L) AIX Technical Reference FEOF(3s,L)
ERROR CONDITIONS
The feof, ferror, and fileno subroutines fail if one or more of the following
are true:
EBADF The file descriptor underlying stream is not valid.
EBADF The stream argument is not a valid stream.
RELATED INFORMATION
In this book: "fopen, freopen, fdopen," "open, openx, creat," and "stdio."
Processed November 7, 1990 FEOF(3s,L) 2