xref: /csrg-svn/lib/libc/stdio/ferror.3 (revision 48352)
1*48352Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
246070Sbostic.\" All rights reserved.
320418Smckusick.\"
446070Sbostic.\" This code is derived from software contributed to Berkeley by
546070Sbostic.\" Chris Torek.
646070Sbostic.\" %sccs.include.redist.man%
746070Sbostic.\"
8*48352Scael.\"     @(#)ferror.3	6.7 (Berkeley) 04/19/91
946070Sbostic.\"
10*48352Scael.Dd
11*48352Scael.Dt FERROR 3
12*48352Scael.Os
13*48352Scael.Sh NAME
14*48352Scael.Nm clearerr ,
15*48352Scael.Nm feof ,
16*48352Scael.Nm ferror ,
17*48352Scael.Nm fileno
18*48352Scael.Nd check and reset stream status
19*48352Scael.Sh SYNOPSIS
20*48352Scael.Fd #include <stdio.h>
21*48352Scael.Ft void
22*48352Scael.Fn clearerr "FILE *stream"
23*48352Scael.Ft int
24*48352Scael.Fn feof "FILE *stream"
25*48352Scael.Ft int
26*48352Scael.Fn ferror "FILE *stream"
27*48352Scael.Ft int
28*48352Scael.Fn fileno "FILE *stream"
29*48352Scael.Sh DESCRIPTION
30*48352ScaelThe function
31*48352Scael.Fn clearerr
3246070Sbosticclears the end-of-file and error indicators for the stream pointed
33*48352Scaelto by
34*48352Scael.Fa stream .
35*48352Scael.Pp
36*48352ScaelThe function
37*48352Scael.Fn feof
3846070Sbostictests the end-of-file indicator for the stream pointed to by
39*48352Scael.Fa stream ,
4046070Sbosticreturning non-zero if it is set.
41*48352ScaelThe end-of-file indicator can only be cleared by the function
42*48352Scael.Fn clearerr .
43*48352Scael.Pp
44*48352ScaelThe function
45*48352Scael.Fn ferror
4646070Sbostictests the error indicator for the stream pointed to by
47*48352Scael.Fa stream ,
4846070Sbosticreturning non-zero if it is set.
49*48352ScaelThe error indicator can only be reset by the
50*48352Scael.Fn clearerr
51*48352Scaelfunction.
52*48352Scael.Pp
53*48352ScaelThe function
54*48352Scael.Fn fileno
55*48352Scaelexamines the argument
56*48352Scael.Fa stream
57*48352Scaeland returns its integer desciptor.
58*48352Scael.Sh ERRORS
5947004SbosticThese functions should not fail and do not set the external
6047004Sbosticvariable
61*48352Scael.Va errno .
62*48352Scael.Sh SEE ALSO
63*48352Scael.Xr open 2 ,
64*48352Scael.Xr stdio 3
65*48352Scael.Sh STANDARDS
66*48352ScaelThe functions
67*48352Scael.Fn clearerr ,
68*48352Scael.Fn feof ,
6946070Sbosticand
70*48352Scael.Fn ferror
71*48352Scaelconform to
72*48352Scael.St -ansiC .
73