Pyrogenesis  trunk
werrno.h
Go to the documentation of this file.
1 /* Copyright (c) 2010 Wildfire Games
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject to
9  * the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef INCLUDED_WERRNO
24 #define INCLUDED_WERRNO
25 
26 //
27 // <errno.h>
28 //
29 
30 #include <errno.h>
31 
32 // this is an exhaustive list of SUSv3 error codes;
33 // see http://www.opengroup.org/onlinepubs/009695399/basedefs/errno.h.html .
34 
35 // defined by VC errno.h and SUSv3
36 // (commented out so that we use VC errno.h's already correct values)
37 #if 0
38 #define EPERM 1 // Operation not permitted
39 #define ENOENT 2 // No such file or directory
40 #define ESRCH 3 // No such process
41 #define EINTR 4 // Interrupted system call
42 #define EIO 5 // I/O error
43 #define ENXIO 6 // No such device or address
44 #define E2BIG 7 // Argument list too long
45 #define ENOEXEC 8 // Exec format error
46 #define EBADF 9 // Bad file number
47 #define ECHILD 10 // No child processes
48 #define EAGAIN 11 // Try again
49 #define ENOMEM 12 // Out of memory
50 #define EACCES 13 // Permission denied
51 #define EFAULT 14 // Bad address
52 #define EBUSY 16 // Device or resource busy
53 #define EEXIST 17 // File exists
54 #define ENODEV 19 // No such device
55 #define ENOTDIR 20 // Not a directory
56 #define EISDIR 21 // Is a directory
57 #define EINVAL 22 // Invalid argument
58 #define ENFILE 23 // File table overflow
59 #define EMFILE 24 // Too many open files
60 #define ENOTTY 25 // Not a typewriter
61 #define EFBIG 27 // File too large
62 #define ENOSPC 28 // No space left on device
63 #define ESPIPE 29 // Illegal seek
64 #define EMLINK 31 // Too many links
65 #define EPIPE 32 // Broken pipe
66 #define EDOM 33 // Math argument out of domain of func
67 #define ERANGE 34 // Math result not representable
68 #endif
69 
70 // defined by VC errno.h and also SUSv3 (with different values)
71 // (commented out because we must match the values used by the compiled CRT)
72 #if 0
73 #define EDEADLK 35 // Resource deadlock would occur
74 #define ENAMETOOLONG 36 // File name too long
75 #define ENOLCK 37 // No record locks available
76 #define ENOSYS 38 // Function not implemented
77 #define ENOTEMPTY 39 // Directory not empty
78 #define EILSEQ 84 // Illegal byte sequence
79 #endif
80 
81 // defined by winsock2 and also Linux (with different values)
82 // (values derived from winsock2 WSA* constants minus WSABASEERR)
83 // update: disabled on newer Boost versions because filesystem drags in boost/cerrno.hpp
84 #if (!defined(BOOST_VERSION) || BOOST_VERSION <= 103401) && (!MSC_VERSION || MSC_VERSION < 1600)
85 #define EWOULDBLOCK 35
86 #define EINPROGRESS 36
87 #define EALREADY 37
88 #define ENOTSOCK 38
89 #define EDESTADDRREQ 39
90 #define EMSGSIZE 40
91 #define EPROTOTYPE 41
92 #define ENOPROTOOPT 42
93 #define EPROTONOSUPPORT 43
94 #define EOPNOTSUPP 45
95 #define EAFNOSUPPORT 47
96 #define EADDRINUSE 48
97 #define EADDRNOTAVAIL 49
98 #define ENETDOWN 50
99 #define ENETUNREACH 51
100 #define ENETRESET 52
101 #define ECONNABORTED 53
102 #define ECONNRESET 54
103 #define ENOBUFS 55
104 #define EISCONN 56
105 #define ENOTCONN 57
106 #define ETIMEDOUT 60
107 #define ECONNREFUSED 61
108 #define EHOSTUNREACH 65
109 #define EDQUOT 69
110 #define ESTALE 70
111 #endif
112 
113 // defined by winsock2 but not Linux
114 // (commented out because they're not portable)
115 #if 0
116 #define ESOCKTNOSUPPORT 44
117 #define EPFNOSUPPORT 46
118 #define ESHUTDOWN 58
119 #define ETOOMANYREFS 59
120 #define ELOOP 62
121 #define EHOSTDOWN 64
122 #define EPROCLIM 67
123 #define EUSERS 68
124 #define EREMOTE 71
125 #endif
126 
127 // defined by Linux but not winsock2
128 // (commented out because they're not generated on Windows and thus
129 // probably shouldn't be used)
130 #if 0
131 #define ENOMSG 42 // No message of desired type
132 #define EIDRM 43 // Identifier removed
133 #define ENOLINK 67 // Reserved
134 #define EPROTO 71 // Protocol error
135 #define EMULTIHOP 72 // Reserved
136 #define EBADMSG 74 // Not a data message
137 #define EOVERFLOW 75 // Value too large for defined data type
138 #define ECANCELED 125 // Operation Canceled
139 #endif
140 
141 #endif // #ifndef INCLUDED_WERRNO