| 1 | .\" Copyright (c) 1980 Regents of the University of California. |
| 2 | .\" All rights reserved. The Berkeley software License Agreement |
| 3 | .\" specifies the terms and conditions for redistribution. |
| 4 | .\" |
| 5 | .\" @(#)ferror.3 6.4 (Berkeley) %G% |
| 6 | .\" |
| 7 | .TH FERROR 3 "" |
| 8 | .UC 4 |
| 9 | .SH NAME |
| 10 | ferror, feof, clearerr, fileno \- stream status inquiries |
| 11 | .SH SYNOPSIS |
| 12 | .B #include <stdio.h> |
| 13 | .PP |
| 14 | .B feof(stream) |
| 15 | .br |
| 16 | .SM |
| 17 | .B FILE |
| 18 | .B *stream; |
| 19 | .PP |
| 20 | .B ferror(stream) |
| 21 | .br |
| 22 | .SM |
| 23 | .B FILE |
| 24 | .B *stream |
| 25 | .PP |
| 26 | .B clearerr(stream) |
| 27 | .br |
| 28 | .SM |
| 29 | .B FILE |
| 30 | .B *stream |
| 31 | .PP |
| 32 | .B fileno(stream) |
| 33 | .br |
| 34 | .SM |
| 35 | .B FILE |
| 36 | .B *stream; |
| 37 | .SH DESCRIPTION |
| 38 | .I Feof |
| 39 | returns non-zero when end of file is read on the named input |
| 40 | .IR stream , |
| 41 | otherwise zero. |
| 42 | Unless cleared by |
| 43 | .IR clearerr , |
| 44 | the end-of-file indication lasts until |
| 45 | the stream is closed. |
| 46 | .PP |
| 47 | .I Ferror |
| 48 | returns non-zero when an error has occurred reading or writing |
| 49 | the named |
| 50 | .IR stream , |
| 51 | otherwise zero. |
| 52 | Unless cleared by |
| 53 | .IR clearerr , |
| 54 | the error indication lasts until |
| 55 | the stream is closed. |
| 56 | .PP |
| 57 | .I Clearerr |
| 58 | resets the error and end-of-file indicators on the named |
| 59 | .IR stream . |
| 60 | .PP |
| 61 | .I Fileno |
| 62 | returns the integer file descriptor |
| 63 | associated with the |
| 64 | .IR stream , |
| 65 | see |
| 66 | .IR open (2). |
| 67 | .PP |
| 68 | Currently all of these functions |
| 69 | are implemented as macros; |
| 70 | they cannot be redeclared. |
| 71 | .SH "SEE ALSO" |
| 72 | open(2), fopen(3) |