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