xref: /csrg-svn/lib/libc/stdio/ferror.3 (revision 66940)
161180Sbostic.\" Copyright (c) 1990, 1991, 1993
261180Sbostic.\"	The Regents of the University of California.  All rights reserved.
320418Smckusick.\"
446070Sbostic.\" This code is derived from software contributed to Berkeley by
550287Sbostic.\" Chris Torek and the American National Standards Committee X3,
650287Sbostic.\" on Information Processing Systems.
750287Sbostic.\"
846070Sbostic.\" %sccs.include.redist.man%
946070Sbostic.\"
10*66940Sbostic.\"     @(#)ferror.3	8.2 (Berkeley) 04/19/94
1146070Sbostic.\"
1248352Scael.Dd
1348352Scael.Dt FERROR 3
1448352Scael.Os
1548352Scael.Sh NAME
1648352Scael.Nm clearerr ,
1748352Scael.Nm feof ,
1848352Scael.Nm ferror ,
1948352Scael.Nm fileno
2048352Scael.Nd check and reset stream status
2148352Scael.Sh SYNOPSIS
2248352Scael.Fd #include <stdio.h>
2348352Scael.Ft void
2448352Scael.Fn clearerr "FILE *stream"
2548352Scael.Ft int
2648352Scael.Fn feof "FILE *stream"
2748352Scael.Ft int
2848352Scael.Fn ferror "FILE *stream"
2948352Scael.Ft int
3048352Scael.Fn fileno "FILE *stream"
3148352Scael.Sh DESCRIPTION
3248352ScaelThe function
3348352Scael.Fn clearerr
3446070Sbosticclears the end-of-file and error indicators for the stream pointed
3548352Scaelto by
3648352Scael.Fa stream .
3748352Scael.Pp
3848352ScaelThe function
3948352Scael.Fn feof
4046070Sbostictests the end-of-file indicator for the stream pointed to by
4148352Scael.Fa stream ,
4246070Sbosticreturning non-zero if it is set.
4348352ScaelThe end-of-file indicator can only be cleared by the function
4448352Scael.Fn clearerr .
4548352Scael.Pp
4648352ScaelThe function
4748352Scael.Fn ferror
4846070Sbostictests the error indicator for the stream pointed to by
4948352Scael.Fa stream ,
5046070Sbosticreturning non-zero if it is set.
5148352ScaelThe error indicator can only be reset by the
5248352Scael.Fn clearerr
5348352Scaelfunction.
5448352Scael.Pp
5548352ScaelThe function
5648352Scael.Fn fileno
5748352Scaelexamines the argument
5848352Scael.Fa stream
59*66940Sbosticand returns its integer descriptor.
6048352Scael.Sh ERRORS
6147004SbosticThese functions should not fail and do not set the external
6247004Sbosticvariable
6348352Scael.Va errno .
6448352Scael.Sh SEE ALSO
6548352Scael.Xr open 2 ,
6648352Scael.Xr stdio 3
6748352Scael.Sh STANDARDS
6848352ScaelThe functions
6948352Scael.Fn clearerr ,
7048352Scael.Fn feof ,
7146070Sbosticand
7248352Scael.Fn ferror
7348352Scaelconform to
7448352Scael.St -ansiC .
75