new stdio
[unix-history] / usr / src / lib / libc / stdio / ferror.3
.\" Copyright (c) 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Chris Torek.
.\"
.\" %sccs.include.redist.man%
.\"
.\" @(#)ferror.3 6.5 (Berkeley) %G%
.\"
.TH FERROR 3 ""
.UC 7
.SH NAME
clearerr, feof, ferror, fileno \- stream status inquiries
.SH SYNOPSIS
.nf
.ft B
#include <stdio.h>
void
clearerr(FILE *stream);
int
feof(FILE *stream);
int
ferror(FILE *stream);
int
fileno(FILE *stream);
.ft R
.fi
.SH DESCRIPTION
.I Clearerr
clears the end-of-file and error indicators for the stream pointed
to by
.IR stream .
.PP
.I Feof
tests the end-of-file indicator for the stream pointed to by
.IR stream ,
returning non-zero if it is set.
The end-of-file indicator can only be cleared by
.IR clearerr .
.PP
.I Ferror
tests the error indicator for the stream pointed to by
.IR stream ,
returning non-zero if it is set.
The error indicator can only be cleared by
.IR clearerr .
.PP
.I Fileno
returns the integer file descriptor associated with the
.I stream
(see
.IR open (2)).
.SH "SEE ALSO"
open(2), stdio(3)
.SH STANDARDS
.IR Clearerr ,
.IR feof ,
and
.I ferror
conform to ANSI X3.159-1989 (``ANSI C'').