1FERROR(3)                  Linux Programmer's Manual                 FERROR(3)
2
3
4

NAME

6       clearerr, feof, ferror, fileno - check and reset stream status
7

SYNOPSIS

9       #include <stdio.h>
10
11       void clearerr(FILE *stream);
12
13       int feof(FILE *stream);
14
15       int ferror(FILE *stream);
16
17       int fileno(FILE *stream);
18
19   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
20
21       fileno(): _POSIX_C_SOURCE
22

DESCRIPTION

24       The function clearerr() clears the end-of-file and error indicators for
25       the stream pointed to by stream.
26
27       The function feof() tests the  end-of-file  indicator  for  the  stream
28       pointed  to by stream, returning nonzero if it is set.  The end-of-file
29       indicator can be cleared only by the function clearerr().
30
31       The function ferror() tests the error indicator for the stream  pointed
32       to  by stream, returning nonzero if it is set.  The error indicator can
33       be reset only by the clearerr() function.
34
35       The function fileno() examines the  argument  stream  and  returns  its
36       integer file descriptor.
37
38       For nonlocking counterparts, see unlocked_stdio(3).
39

ERRORS

41       These  functions  should  not fail and do not set the external variable
42       errno.  (However, in case fileno() detects that its argument is  not  a
43       valid stream, it must return -1 and set errno to EBADF.)
44

ATTRIBUTES

46       For   an   explanation   of   the  terms  used  in  this  section,  see
47       attributes(7).
48
49       ┌────────────────────┬───────────────┬─────────┐
50Interface           Attribute     Value   
51       ├────────────────────┼───────────────┼─────────┤
52clearerr(), feof(), │ Thread safety │ MT-Safe │
53ferror(), fileno()  │               │         │
54       └────────────────────┴───────────────┴─────────┘

CONFORMING TO

56       The functions clearerr(), feof(), and ferror()  conform  to  C89,  C99,
57       POSIX.1-2001, and POSIX.1-2008.
58
59       The function fileno() conforms to POSIX.1-2001 and POSIX.1-2008.
60

SEE ALSO

62       open(2), fdopen(3), stdio(3), unlocked_stdio(3)
63

COLOPHON

65       This  page  is  part of release 4.15 of the Linux man-pages project.  A
66       description of the project, information about reporting bugs,  and  the
67       latest     version     of     this    page,    can    be    found    at
68       https://www.kernel.org/doc/man-pages/.
69
70
71
72                                  2017-09-15                         FERROR(3)
Impressum