1 .\" Copyright (c) 1990, 1991 The Regents of the University of California.
2 .\" and Copyright (C) 2021 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" All rights reserved.
5 .\" This code is derived from software contributed to Berkeley by
6 .\" Chris Torek and the American National Standards Committee X3,
7 .\" on Information Processing Systems.
9 .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. All advertising materials mentioning features or use of this software
19 .\" must display the following acknowledgement:
20 .\" This product includes software developed by the University of
21 .\" California, Berkeley and its contributors.
22 .\" 4. Neither the name of the University nor the names of its contributors
23 .\" may be used to endorse or promote products derived from this software
24 .\" without specific prior written permission.
26 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 .\" @(#)ferror.3 6.8 (Berkeley) 6/29/91
42 .\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu
44 .TH FERROR 3 2021-03-22 "" "Linux Programmer's Manual"
46 clearerr, feof, ferror \- check and reset stream status
51 .BI "void clearerr(FILE *" stream );
52 .BI "int feof(FILE *" stream );
53 .BI "int ferror(FILE *" stream );
58 clears the end-of-file and error indicators for the stream pointed to by
63 tests the end-of-file indicator for the stream pointed to by
65 returning nonzero if it is set.
66 The end-of-file indicator can be cleared only by the function
71 tests the error indicator for the stream pointed to by
73 returning nonzero if it is set.
74 The error indicator can be reset only by the
78 For nonlocking counterparts, see
79 .BR unlocked_stdio (3).
83 function returns nonzero if the end-of-file indicator is set for
85 otherwise, it returns zero.
89 function returns nonzero if the error indicator is set for
91 otherwise, it returns zero.
93 These functions should not fail and do not set
96 For an explanation of the terms used in this section, see
104 Interface Attribute Value
109 T} Thread safety MT-Safe
120 conform to C89, C99, POSIX.1-2001, and POSIX.1-2008.
122 POSIX.1-2008 specifies
123 .\"https://www.austingroupbugs.net/view.php?id=401
124 that these functions shall not change the value of
134 .BR unlocked_stdio (3)