1 /* _PDCLIB_allocpages( int const )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
7 /* This is a stub implementation of _PDCLIB_allocpages
12 #include <wchar.h> // Watcom bug: winnt.h assumes string.h defines wchar_t
15 void _PDCLIB_w32errno(void);
17 void _PDCLIB_w32errno(void)
20 switch(GetLastError()) {
23 case ERROR_FILE_NOT_FOUND:
24 case ERROR_PATH_NOT_FOUND:
25 case ERROR_INVALID_DRIVE:
26 errno = ENOENT; break;
27 case ERROR_TOO_MANY_OPEN_FILES:
28 errno = EMFILE; break;
29 case ERROR_ACCESS_DENIED:
30 case ERROR_WRITE_PROTECT:
32 case ERROR_INVALID_HANDLE:
34 case ERROR_NOT_ENOUGH_MEMORY:
35 case ERROR_OUTOFMEMORY:
36 errno = ENOMEM; break;
38 errno = EAGAIN; break;
39 case ERROR_BAD_LENGTH:
40 errno = EINVAL; break;
42 // TODO: reconsider what to use here?
43 errno = ENOSYS; break;
50 #include "_PDCLIB_test.h"