1 /*****************************************************************************/
9 /* (C) 1998-2010, Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
41 /*****************************************************************************/
43 /*****************************************************************************/
47 /* Operating system specific error code */
48 extern unsigned char _oserror;
51 /* System errors go here */
54 /* errno must be a macro */
58 /* Possible error codes */
59 #define ENOENT 1 /* No such file or directory */
60 #define ENOMEM 2 /* Out of memory */
61 #define EACCES 3 /* Permission denied */
62 #define ENODEV 4 /* No such device */
63 #define EMFILE 5 /* Too many open files */
64 #define EBUSY 6 /* Device or resource busy */
65 #define EINVAL 7 /* Invalid argument */
66 #define ENOSPC 8 /* No space left on device */
67 #define EEXIST 9 /* File exists */
68 #define EAGAIN 10 /* Try again */
69 #define EIO 11 /* I/O error */
70 #define EINTR 12 /* Interrupted system call */
71 #define ENOSYS 13 /* Function not implemented */
72 #define ESPIPE 14 /* Illegal seek */
73 #define ERANGE 15 /* Range error */
74 #define EBADF 16 /* Bad file number */
75 #define EUNKNOWN 17 /* Unknown OS specific error */
79 /*****************************************************************************/
81 /*****************************************************************************/
85 int __fastcall__ _osmaperrno (unsigned char oserror);
86 /* Map an operating system specific error code (for example from _oserror)
87 * into one of the E... codes above. It is user callable.
90 unsigned char __fastcall__ _seterrno (unsigned char code);
91 /* Set errno to a specific error code and return zero. Used by the library */
93 int __fastcall__ _directerrno (unsigned char code);
94 /* Set errno to a specific error code, clear _oserror and return -1. Used
98 int __fastcall__ _mappederrno (unsigned char code);
99 /* Set _oserror to the given platform specific error code. If it is a real
100 * error code (not zero) set errno to the corresponding system error code
101 * and return -1. Otherwise return zero.
102 * Used by the library.