[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

feof, ferror, clearerr, or fileno Macro

Purpose

Checks the status of a stream.

Library

Standard C Library (libc.a)

Syntax

#include <stdio.h>
int feof (Stream)
FILE *Stream;
int ferror (Stream)
FILE *Stream;
void clearerr (Stream)
FILE *Stream;
int fileno (Stream)
FILE *Stream;

Description

The feof macro inquires about the end-of-file character (EOF). 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 or 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 inquires about the status of a stream. The clearerr macro resets the error indicator and the EOF indicator to a value of 0 for the stream specified by the Stream parameter.

The fileno macro inquires about the status of a stream. The fileno macro returns the integer file descriptor associated with the stream pointed to by the Stream parameter. Otherwise a value of -1 is returned.

Parameters

Stream Specifies the input or output stream.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The fopen, freopen, or fdopen subroutine, open subroutine.

Input and Output Handling Programmer's Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]