fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / stdio / feof.c
blobb7981bded0778f82cb85ad1a5282f70dd9f6091e
1 /*
2 FUNCTION
3 <<feof>>---test for end of file
5 INDEX
6 feof
8 ANSI_SYNOPSIS
9 #include <stdio.h>
10 int feof(FILE *<[fp]>);
12 TRAD_SYNOPSIS
13 #include <stdio.h>
14 int feof(<[fp]>)
15 FILE *<[fp]>;
17 DESCRIPTION
18 <<feof>> tests whether or not the end of the file identified by <[fp]>
19 has been reached.
21 RETURNS
22 <<feof>> returns <<0>> if the end of file has not yet been reached; if
23 at end of file, the result is nonzero.
25 PORTABILITY
26 <<feof>> is required by ANSI C.
28 No supporting OS subroutines are required.
31 #include <stdio.h>
33 #undef feof
35 int
36 _DEFUN (feof, (fp),
37 FILE * fp)
39 int result;
40 _flockfile(fp);
41 result = __sfeof (fp);
42 _funlockfile(fp);
43 return result;