]> pd.if.org Git - pdclib/blob - functions/errno/errno.c
Moved errno to main codebase.
[pdclib] / functions / errno / errno.c
1 /* _PDCLIB_errno
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 <errno.h>
8 #ifndef REGTEST
9 #include <threads.h>
10
11 /* Temporary */
12
13 static int _PDCLIB_errno = 0;
14
15 int * _PDCLIB_errno_func()
16 {
17     return &_PDCLIB_errno;
18 }
19
20 #endif
21
22 #ifdef TEST
23 #include "_PDCLIB_test.h"
24
25 int main( void )
26 {
27     errno = 0;
28     TESTCASE( errno == 0 );
29     errno = EDOM;
30     TESTCASE( errno == EDOM );
31     errno = ERANGE;
32     TESTCASE( errno == ERANGE );
33     return TEST_RESULTS;
34 }
35
36 #endif
37