Commit | Line | Data |
---|---|---|
ae59e04c | 1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
639aed4c | 2 | .\" All rights reserved. |
31c2cc46 | 3 | .\" |
639aed4c KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" Chris Torek. | |
639aed4c KB |
6 | .\" %sccs.include.redist.man% |
7 | .\" | |
ae59e04c | 8 | .\" @(#)ferror.3 6.7 (Berkeley) %G% |
639aed4c | 9 | .\" |
ae59e04c CL |
10 | .Dd |
11 | .Dt FERROR 3 | |
12 | .Os | |
13 | .Sh NAME | |
14 | .Nm clearerr , | |
15 | .Nm feof , | |
16 | .Nm ferror , | |
17 | .Nm fileno | |
18 | .Nd check and reset stream status | |
19 | .Sh SYNOPSIS | |
20 | .Fd #include <stdio.h> | |
21 | .Ft void | |
22 | .Fn clearerr "FILE *stream" | |
23 | .Ft int | |
24 | .Fn feof "FILE *stream" | |
25 | .Ft int | |
26 | .Fn ferror "FILE *stream" | |
27 | .Ft int | |
28 | .Fn fileno "FILE *stream" | |
29 | .Sh DESCRIPTION | |
30 | The function | |
31 | .Fn clearerr | |
639aed4c | 32 | clears the end-of-file and error indicators for the stream pointed |
ae59e04c CL |
33 | to by |
34 | .Fa stream . | |
35 | .Pp | |
36 | The function | |
37 | .Fn feof | |
639aed4c | 38 | tests the end-of-file indicator for the stream pointed to by |
ae59e04c | 39 | .Fa stream , |
639aed4c | 40 | returning non-zero if it is set. |
ae59e04c CL |
41 | The end-of-file indicator can only be cleared by the function |
42 | .Fn clearerr . | |
43 | .Pp | |
44 | The function | |
45 | .Fn ferror | |
639aed4c | 46 | tests the error indicator for the stream pointed to by |
ae59e04c | 47 | .Fa stream , |
639aed4c | 48 | returning non-zero if it is set. |
ae59e04c CL |
49 | The error indicator can only be reset by the |
50 | .Fn clearerr | |
51 | function. | |
52 | .Pp | |
53 | The function | |
54 | .Fn fileno | |
55 | examines the argument | |
56 | .Fa stream | |
57 | and returns its integer desciptor. | |
58 | .Sh ERRORS | |
c07f2720 KB |
59 | These functions should not fail and do not set the external |
60 | variable | |
ae59e04c CL |
61 | .Va errno . |
62 | .Sh SEE ALSO | |
63 | .Xr open 2 , | |
64 | .Xr stdio 3 | |
65 | .Sh STANDARDS | |
66 | The functions | |
67 | .Fn clearerr , | |
68 | .Fn feof , | |
639aed4c | 69 | and |
ae59e04c CL |
70 | .Fn ferror |
71 | conform to | |
72 | .St -ansiC . |