1 /*
2 FUNCTION
3 <<feof>>---test for end of file
4 
5 INDEX
6 	feof
7 
8 ANSI_SYNOPSIS
9 	#include <stdio.h>
10 	int feof(FILE *<[fp]>);
11 
12 TRAD_SYNOPSIS
13 	#include <stdio.h>
14 	int feof(<[fp]>)
15 	FILE *<[fp]>;
16 
17 DESCRIPTION
18 <<feof>> tests whether or not the end of the file identified by <[fp]>
19 has been reached.
20 
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.
24 
25 PORTABILITY
26 <<feof>> is required by ANSI C.
27 
28 No supporting OS subroutines are required.
29 */
30 
31 #include <stdio.h>
32 
33 #undef feof
34 
35 int
36 _DEFUN (feof, (fp),
37 	FILE * fp)
38 {
39   int result;
40   _flockfile(fp);
41   result = __sfeof (fp);
42   _funlockfile(fp);
43   return result;
44 }
45