Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/waterbox/libc/functions/stdio/ferror.c
2 views
1
/* ferror( FILE * )
2
3
This file is part of the Public Domain C Library (PDCLib).
4
Permission is granted to use, modify, and / or redistribute at will.
5
*/
6
7
#include <stdio.h>
8
9
#ifndef REGTEST
10
#include "_PDCLIB_io.h"
11
12
int _PDCLIB_ferror_unlocked( FILE * stream )
13
{
14
return stream->status & _PDCLIB_ERRORFLAG;
15
}
16
17
int ferror( FILE * stream )
18
{
19
_PDCLIB_flockfile( stream );
20
int error = _PDCLIB_ferror_unlocked( stream );
21
_PDCLIB_funlockfile( stream );
22
return error;
23
}
24
25
#endif
26
27
#ifdef TEST
28
#include "_PDCLIB_test.h"
29
30
int main( void )
31
{
32
/* Testing covered by clearerr(). */
33
return TEST_RESULTS;
34
}
35
36
#endif
37
38
39