Rev 4921 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4921 | Rev 6099 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 1990 The Regents of the University of California. |
2 | * Copyright (c) 1990 The Regents of the University of California. |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms are permitted |
5 | * Redistribution and use in source and binary forms are permitted |
6 | * provided that the above copyright notice and this paragraph are |
6 | * provided that the above copyright notice and this paragraph are |
7 | * duplicated in all such forms and that any documentation, |
7 | * duplicated in all such forms and that any documentation, |
8 | * advertising materials, and other materials related to such |
8 | * advertising materials, and other materials related to such |
9 | * distribution and use acknowledge that the software was developed |
9 | * distribution and use acknowledge that the software was developed |
10 | * by the University of California, Berkeley. The name of the |
10 | * by the University of California, Berkeley. The name of the |
11 | * University may not be used to endorse or promote products derived |
11 | * University may not be used to endorse or promote products derived |
12 | * from this software without specific prior written permission. |
12 | * from this software without specific prior written permission. |
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
15 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
15 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
16 | */ |
16 | */ |
17 | 17 | ||
18 | /* |
18 | /* |
19 | FUNCTION |
19 | FUNCTION |
20 | < |
20 | < |
21 | 21 | ||
22 | INDEX |
22 | INDEX |
23 | feof |
23 | feof |
- | 24 | INDEX |
|
- | 25 | feof_unlocked |
|
24 | 26 | ||
25 | ANSI_SYNOPSIS |
27 | ANSI_SYNOPSIS |
26 | #include |
28 | #include |
27 | int feof(FILE *<[fp]>); |
29 | int feof(FILE *<[fp]>); |
- | 30 | ||
- | 31 | #define _BSD_SOURCE |
|
- | 32 | #include |
|
- | 33 | int feof_unlocked(FILE *<[fp]>); |
|
28 | 34 | ||
29 | TRAD_SYNOPSIS |
35 | TRAD_SYNOPSIS |
30 | #include |
36 | #include |
31 | int feof(<[fp]>) |
37 | int feof(<[fp]>) |
32 | FILE *<[fp]>; |
38 | FILE *<[fp]>; |
- | 39 | ||
- | 40 | #define _BSD_SOURCE |
|
- | 41 | #include |
|
- | 42 | int feof_unlocked(<[fp]>) |
|
- | 43 | FILE *<[fp]>; |
|
33 | 44 | ||
34 | DESCRIPTION |
45 | DESCRIPTION |
35 | < |
46 | < |
36 | has been reached. |
47 | has been reached. |
- | 48 | ||
- | 49 | < |
|
- | 50 | < |
|
- | 51 | protected by flockfile() (or ftrylockfile()) and funlockfile(). This |
|
- | 52 | function may safely be used in a multi-threaded program if and only |
|
- | 53 | if they are called while the invoking thread owns the (FILE *) |
|
- | 54 | object, as is the case after a successful call to the flockfile() or |
|
- | 55 | ftrylockfile() functions. If threads are disabled, then |
|
- | 56 | < |
|
37 | 57 | ||
38 | RETURNS |
58 | RETURNS |
39 | < |
59 | < |
40 | at end of file, the result is nonzero. |
60 | at end of file, the result is nonzero. |
41 | 61 | ||
42 | PORTABILITY |
62 | PORTABILITY |
43 | < |
63 | < |
- | 64 | ||
- | 65 | < |
|
44 | 66 | ||
45 | No supporting OS subroutines are required. |
67 | No supporting OS subroutines are required. |
46 | */ |
68 | */ |
47 | 69 | ||
48 | #include |
70 | #include |
49 | #include "local.h" |
71 | #include "local.h" |
50 | 72 | ||
51 | /* A subroutine version of the macro feof. */ |
73 | /* A subroutine version of the macro feof. */ |
52 | 74 | ||
53 | #undef feof |
75 | #undef feof |
54 | 76 | ||
55 | int |
77 | int |
56 | _DEFUN(feof, (fp), |
78 | _DEFUN(feof, (fp), |
57 | FILE * fp) |
79 | FILE * fp) |
58 | { |
80 | { |
59 | int result; |
81 | int result; |
60 | CHECK_INIT(_REENT, fp); |
82 | CHECK_INIT(_REENT, fp); |
61 | _newlib_flockfile_start (fp); |
83 | _newlib_flockfile_start (fp); |
62 | result = __sfeof (fp); |
84 | result = __sfeof (fp); |
63 | _newlib_flockfile_end (fp); |
85 | _newlib_flockfile_end (fp); |
64 | return result; |
86 | return result; |
65 | } |
87 | } |