no SCCS file; new copyright; att/bsd/shared
[unix-history] / usr / src / lib / libc / stdio / ferror.3
CommitLineData
639aed4c
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
31c2cc46 3.\"
639aed4c
KB
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek.
31c2cc46 6.\"
639aed4c
KB
7.\" %sccs.include.redist.man%
8.\"
c07f2720 9.\" @(#)ferror.3 6.6 (Berkeley) %G%
639aed4c
KB
10.\"
11.TH FERROR 3 ""
12.UC 7
31c2cc46 13.SH NAME
639aed4c 14clearerr, feof, ferror, fileno \- stream status inquiries
31c2cc46 15.SH SYNOPSIS
639aed4c
KB
16.nf
17.ft B
18#include <stdio.h>
19
20void
21clearerr(FILE *stream);
22
23int
24feof(FILE *stream);
25
26int
27ferror(FILE *stream);
28
29int
30fileno(FILE *stream);
31.ft R
32.fi
31c2cc46 33.SH DESCRIPTION
639aed4c
KB
34.I Clearerr
35clears the end-of-file and error indicators for the stream pointed
36to by
37.IR stream .
38.PP
31c2cc46 39.I Feof
639aed4c 40tests the end-of-file indicator for the stream pointed to by
68b48c9d 41.IR stream ,
639aed4c
KB
42returning non-zero if it is set.
43The end-of-file indicator can only be cleared by
44.IR clearerr .
31c2cc46
KM
45.PP
46.I Ferror
639aed4c 47tests the error indicator for the stream pointed to by
68b48c9d 48.IR stream ,
639aed4c
KB
49returning non-zero if it is set.
50The error indicator can only be cleared by
51.IR clearerr .
31c2cc46
KM
52.PP
53.I Fileno
639aed4c
KB
54returns the integer file descriptor associated with the
55.I stream
56(see
57.IR open (2)).
c07f2720
KB
58.SH ERRORS
59These functions should not fail and do not set the external
60variable
61.IR errno .
31c2cc46 62.SH "SEE ALSO"
639aed4c
KB
63open(2), stdio(3)
64.SH STANDARDS
65.IR Clearerr ,
66.IR feof ,
67and
68.I ferror
69conform to ANSI X3.159-1989 (``ANSI C'').