]> pd.if.org Git - pdclib.old/blob - functions/stdio/ferror.c
[gandr] s/__lp64__/__LP64__/ to match GCC define
[pdclib.old] / functions / stdio / ferror.c
1 /* $Id$ */
2
3 /* ferror( FILE * )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 #include <stdio.h>
10
11 #ifndef REGTEST
12 #include <_PDCLIB_io.h>
13
14 int _PDCLIB_ferror_unlocked( FILE * stream )
15 {
16     return stream->status & _PDCLIB_ERRORFLAG;
17 }
18
19 int ferror( FILE * stream )
20 {
21     _PDCLIB_flockfile( stream );
22     int error = _PDCLIB_ferror_unlocked( stream );
23     _PDCLIB_funlockfile( stream );
24     return error;
25 }
26
27 #endif
28
29 #ifdef TEST
30 #include <_PDCLIB_test.h>
31
32 int main( void )
33 {
34     /* Testing covered by clearerr(). */
35     return TEST_RESULTS;
36 }
37
38 #endif
39