1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Chris Torek. 6.\" %sccs.include.redist.man% 7.\" 8.\" @(#)ferror.3 6.7 (Berkeley) 04/19/91 9.\" 10.Dd 11.Dt FERROR 3 12.Os 13.Sh NAME 14.Nm clearerr , 15.Nm feof , 16.Nm ferror , 17.Nm fileno 18.Nd check and reset stream status 19.Sh SYNOPSIS 20.Fd #include <stdio.h> 21.Ft void 22.Fn clearerr "FILE *stream" 23.Ft int 24.Fn feof "FILE *stream" 25.Ft int 26.Fn ferror "FILE *stream" 27.Ft int 28.Fn fileno "FILE *stream" 29.Sh DESCRIPTION 30The function 31.Fn clearerr 32clears the end-of-file and error indicators for the stream pointed 33to by 34.Fa stream . 35.Pp 36The function 37.Fn feof 38tests the end-of-file indicator for the stream pointed to by 39.Fa stream , 40returning non-zero if it is set. 41The end-of-file indicator can only be cleared by the function 42.Fn clearerr . 43.Pp 44The function 45.Fn ferror 46tests the error indicator for the stream pointed to by 47.Fa stream , 48returning non-zero if it is set. 49The error indicator can only be reset by the 50.Fn clearerr 51function. 52.Pp 53The function 54.Fn fileno 55examines the argument 56.Fa stream 57and returns its integer desciptor. 58.Sh ERRORS 59These functions should not fail and do not set the external 60variable 61.Va errno . 62.Sh SEE ALSO 63.Xr open 2 , 64.Xr stdio 3 65.Sh STANDARDS 66The functions 67.Fn clearerr , 68.Fn feof , 69and 70.Fn ferror 71conform to 72.St -ansiC . 73