date and time created 91/03/06 18:09:53 by bostic
[unix-history] / usr / src / lib / libc / stdio / ferror.3
index 0b75f60..5151567 100644 (file)
@@ -1,69 +1,69 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)ferror.3    6.1 (Berkeley) %G%
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek.
 .\"
 .\"
-.TH FERROR 3S  ""
-.UC 4
+.\" %sccs.include.redist.man%
+.\"
+.\"    @(#)ferror.3    6.6 (Berkeley) %G%
+.\"
+.TH FERROR 3 ""
+.UC 7
 .SH NAME
 .SH NAME
-ferror, feof, clearerr, fileno \- stream status inquiries
+clearerr, feof, ferror, fileno \- stream status inquiries
 .SH SYNOPSIS
 .SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B feof(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B ferror(stream)
-.br
-.SM
-.B FILE
-.B *stream
-.PP
-.B clearerr(stream)
-.br
-.SM
-.B FILE
-.B *stream
-.PP
-.B fileno(stream)
-.br
-.SM
-.B FILE
-.B *stream;
+.nf
+.ft B
+#include <stdio.h>
+
+void
+clearerr(FILE *stream);
+
+int
+feof(FILE *stream);
+
+int
+ferror(FILE *stream);
+
+int
+fileno(FILE *stream);
+.ft R
+.fi
 .SH DESCRIPTION
 .SH DESCRIPTION
+.I Clearerr
+clears the end-of-file and error indicators for the stream pointed
+to by 
+.IR stream .
+.PP
 .I Feof
 .I Feof
-returns non-zero when end of file is read on the named input
+tests the end-of-file indicator for the stream pointed to by
 .IR stream ,
 .IR stream ,
-otherwise zero.
+returning non-zero if it is set.
+The end-of-file indicator can only be cleared by
+.IR clearerr .
 .PP
 .I Ferror
 .PP
 .I Ferror
-returns non-zero when an error has occurred reading or writing
-the named
+tests the error indicator for the stream pointed to by
 .IR stream ,
 .IR stream ,
-otherwise zero.
-Unless cleared by
-.IR clearerr ,
-the error indication lasts until
-the stream is closed.
-.PP
-.I Clearerr
-resets the error indication on the named
-.IR stream .
+returning non-zero if it is set.
+The error indicator can only be cleared by
+.IR clearerr .
 .PP
 .I Fileno
 .PP
 .I Fileno
-returns the integer file descriptor
-associated with the
-.IR stream ,
-see
-.IR  open (2).
-.PP
-These functions
-are implemented as macros;
-they cannot be redeclared.
+returns the integer file descriptor associated with the
+.I stream
+(see
+.IR open (2)).
+.SH ERRORS
+These functions should not fail and do not set the external
+variable
+.IR errno .
 .SH "SEE ALSO"
 .SH "SEE ALSO"
-fopen(3S),
-open(2)
+open(2), stdio(3)
+.SH STANDARDS
+.IR Clearerr ,
+.IR feof ,
+and
+.I ferror
+conform to ANSI X3.159-1989 (``ANSI C'').