3 /* _PDCLIB_allocpages( int const )
\r
5 This file is part of the Public Domain C Library (PDCLib).
\r
6 Permission is granted to use, modify, and / or redistribute at will.
\r
9 /* This is a stub implementation of _PDCLIB_allocpages
\r
14 #include <wchar.h> // Watcom bug: winnt.h assumes string.h defines wchar_t
\r
15 #include <windows.h>
\r
17 void _PDCLIB_w32errno(void);
\r
19 void _PDCLIB_w32errno(void)
\r
22 switch(GetLastError()) {
\r
25 case ERROR_FILE_NOT_FOUND:
\r
26 case ERROR_PATH_NOT_FOUND:
\r
27 case ERROR_INVALID_DRIVE:
\r
28 errno = ENOENT; break;
\r
29 case ERROR_TOO_MANY_OPEN_FILES:
\r
30 errno = EMFILE; break;
\r
31 case ERROR_ACCESS_DENIED:
\r
32 case ERROR_WRITE_PROTECT:
\r
33 errno = EPERM; break;
\r
34 case ERROR_INVALID_HANDLE:
\r
35 errno = EBADF; break;
\r
36 case ERROR_NOT_ENOUGH_MEMORY:
\r
37 case ERROR_OUTOFMEMORY:
\r
38 errno = ENOMEM; break;
\r
39 case ERROR_NOT_READY:
\r
40 errno = EAGAIN; break;
\r
41 case ERROR_BAD_LENGTH:
\r
42 errno = EINVAL; break;
\r
44 // TODO: reconsider what to use here?
\r
45 errno = ENOSYS; break;
\r
52 #include <_PDCLIB_test.h>
\r
56 return TEST_RESULTS;
\r