macro and text revision (-mdoc version 3)
[unix-history] / usr / src / lib / libc / stdio / ferror.3
CommitLineData
ae59e04c 1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
639aed4c 2.\" All rights reserved.
31c2cc46 3.\"
639aed4c
KB
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek.
639aed4c
KB
6.\" %sccs.include.redist.man%
7.\"
ae59e04c 8.\" @(#)ferror.3 6.7 (Berkeley) %G%
639aed4c 9.\"
ae59e04c
CL
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
639aed4c 32clears the end-of-file and error indicators for the stream pointed
ae59e04c
CL
33to by
34.Fa stream .
35.Pp
36The function
37.Fn feof
639aed4c 38tests the end-of-file indicator for the stream pointed to by
ae59e04c 39.Fa stream ,
639aed4c 40returning non-zero if it is set.
ae59e04c
CL
41The end-of-file indicator can only be cleared by the function
42.Fn clearerr .
43.Pp
44The function
45.Fn ferror
639aed4c 46tests the error indicator for the stream pointed to by
ae59e04c 47.Fa stream ,
639aed4c 48returning non-zero if it is set.
ae59e04c
CL
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
c07f2720
KB
59These functions should not fail and do not set the external
60variable
ae59e04c
CL
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 ,
639aed4c 69and
ae59e04c
CL
70.Fn ferror
71conform to
72.St -ansiC .