1 .\" Copyright (c) 1990, 1991 The Regents of the University of California.
2 .\" All rights reserved.
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.
8 .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\" must display the following acknowledgement:
19 .\" This product includes software developed by the University of
20 .\" California, Berkeley and its contributors.
21 .\" 4. Neither the name of the University nor the names of its contributors
22 .\" may be used to endorse or promote products derived from this software
23 .\" without specific prior written permission.
25 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 .\" @(#)ferror.3 6.8 (Berkeley) 6/29/91
41 .\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu
42 .\" Added remark on EBADF for fileno, aeb, 2001-03-22
44 .TH FERROR 3 2019-03-06 "" "Linux Programmer's Manual"
46 clearerr, feof, ferror, fileno \- check and reset stream status
50 .BI "void clearerr(FILE *" stream );
52 .BI "int feof(FILE *" stream );
54 .BI "int ferror(FILE *" stream );
56 .BI "int fileno(FILE *" stream );
59 Feature Test Macro Requirements for glibc (see
60 .BR feature_test_macros (7)):
68 clears the end-of-file and error indicators for the stream pointed to by
73 tests the end-of-file indicator for the stream pointed to by
75 returning nonzero if it is set.
76 The end-of-file indicator can be cleared only by the function
81 tests the error indicator for the stream pointed to by
83 returning nonzero if it is set.
84 The error indicator can be reset only by the
92 and returns the integer file descriptor used to implement this stream.
93 The file descriptor is still owned by
95 and will be closed when
98 Duplicate the file descriptor with
100 before passing it to code that might close it.
102 For nonlocking counterparts, see
103 .BR unlocked_stdio (3).
105 These functions should not fail and do not set the external variable
109 detects that its argument is not a valid stream, it must
115 For an explanation of the terms used in this section, see
121 Interface Attribute Value
128 T} Thread safety MT-Safe
136 conform to C89, C99, POSIX.1-2001, and POSIX.1-2008.
140 conforms to POSIX.1-2001 and POSIX.1-2008.
145 .BR unlocked_stdio (3)