]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/errnomodule.c
AppPkg/.../Python-2.7.10: AppPkg.dsc, pyconfig.h, PyMod-2.7.10
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / PyMod-2.7.10 / Modules / errnomodule.c
CommitLineData
d11973f1 1/* Errno module\r
3ec97ca4 2\r
d11973f1
DM
3 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
4 This program and the accompanying materials are licensed and made available under\r
5 the terms and conditions of the BSD License that accompanies this distribution.\r
6 The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.\r
8\r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11*/\r
3ec97ca4
DM
12\r
13#include "Python.h"\r
14\r
15/* Windows socket errors (WSA*) */\r
16#ifdef MS_WINDOWS\r
17#include <windows.h>\r
18#endif\r
19\r
20/*\r
21 * Pull in the system error definitions\r
22 */\r
23\r
24static PyMethodDef errno_methods[] = {\r
25 {NULL, NULL}\r
26};\r
27\r
28/* Helper function doing the dictionary inserting */\r
29\r
30static void\r
31_inscode(PyObject *d, PyObject *de, char *name, int code)\r
32{\r
33 PyObject *u = PyString_FromString(name);\r
34 PyObject *v = PyInt_FromLong((long) code);\r
35\r
36 /* Don't bother checking for errors; they'll be caught at the end\r
37 * of the module initialization function by the caller of\r
38 * initerrno().\r
39 */\r
40 if (u && v) {\r
41 /* insert in modules dict */\r
42 PyDict_SetItem(d, u, v);\r
43 /* insert in errorcode dict */\r
44 PyDict_SetItem(de, v, u);\r
45 }\r
46 Py_XDECREF(u);\r
47 Py_XDECREF(v);\r
48}\r
49\r
50PyDoc_STRVAR(errno__doc__,\r
51"This module makes available standard errno system symbols.\n\\r
52\n\\r
53The value of each symbol is the corresponding integer value,\n\\r
54e.g., on most systems, errno.ENOENT equals the integer 2.\n\\r
55\n\\r
56The dictionary errno.errorcode maps numeric codes to symbol names,\n\\r
57e.g., errno.errorcode[2] could be the string 'ENOENT'.\n\\r
58\n\\r
59Symbols that are not relevant to the underlying system are not defined.\n\\r
60\n\\r
61To map error codes to error messages, use the function os.strerror(),\n\\r
62e.g. os.strerror(2) could return 'No such file or directory'.");\r
63\r
64PyMODINIT_FUNC\r
65initerrno(void)\r
66{\r
67 PyObject *m, *d, *de;\r
68 m = Py_InitModule3("errno", errno_methods, errno__doc__);\r
69 if (m == NULL)\r
70 return;\r
71 d = PyModule_GetDict(m);\r
72 de = PyDict_New();\r
73 if (!d || !de || PyDict_SetItemString(d, "errorcode", de) < 0)\r
74 return;\r
75\r
76/* Macro so I don't have to edit each and every line below... */\r
77#define inscode(d, ds, de, name, code, comment) _inscode(d, de, name, code)\r
78\r
79 /*\r
80 * The names and comments are borrowed from linux/include/errno.h,\r
81 * which should be pretty all-inclusive\r
82 */\r
83\r
84#ifdef ENODEV\r
85 inscode(d, ds, de, "ENODEV", ENODEV, "No such device");\r
86#endif\r
87#ifdef ENOCSI\r
88 inscode(d, ds, de, "ENOCSI", ENOCSI, "No CSI structure available");\r
89#endif\r
90#ifdef EHOSTUNREACH\r
91 inscode(d, ds, de, "EHOSTUNREACH", EHOSTUNREACH, "No route to host");\r
92#else\r
93#ifdef WSAEHOSTUNREACH\r
94 inscode(d, ds, de, "EHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");\r
95#endif\r
96#endif\r
97#ifdef ENOMSG\r
98 inscode(d, ds, de, "ENOMSG", ENOMSG, "No message of desired type");\r
99#endif\r
100#ifdef EUCLEAN\r
101 inscode(d, ds, de, "EUCLEAN", EUCLEAN, "Structure needs cleaning");\r
102#endif\r
103#ifdef EL2NSYNC\r
104 inscode(d, ds, de, "EL2NSYNC", EL2NSYNC, "Level 2 not synchronized");\r
105#endif\r
106#ifdef EL2HLT\r
107 inscode(d, ds, de, "EL2HLT", EL2HLT, "Level 2 halted");\r
108#endif\r
109#ifdef ENODATA\r
110 inscode(d, ds, de, "ENODATA", ENODATA, "No data available");\r
111#endif\r
112#ifdef ENOTBLK\r
113 inscode(d, ds, de, "ENOTBLK", ENOTBLK, "Block device required");\r
114#endif\r
115#ifdef ENOSYS\r
116 inscode(d, ds, de, "ENOSYS", ENOSYS, "Function not implemented");\r
117#endif\r
118#ifdef EPIPE\r
119 inscode(d, ds, de, "EPIPE", EPIPE, "Broken pipe");\r
120#endif\r
121#ifdef EINVAL\r
122 inscode(d, ds, de, "EINVAL", EINVAL, "Invalid argument");\r
123#else\r
124#ifdef WSAEINVAL\r
125 inscode(d, ds, de, "EINVAL", WSAEINVAL, "Invalid argument");\r
126#endif\r
127#endif\r
128#ifdef EOVERFLOW\r
129 inscode(d, ds, de, "EOVERFLOW", EOVERFLOW, "Value too large for defined data type");\r
130#endif\r
131#ifdef EADV\r
132 inscode(d, ds, de, "EADV", EADV, "Advertise error");\r
133#endif\r
134#ifdef EINTR\r
135 inscode(d, ds, de, "EINTR", EINTR, "Interrupted system call");\r
136#else\r
137#ifdef WSAEINTR\r
138 inscode(d, ds, de, "EINTR", WSAEINTR, "Interrupted system call");\r
139#endif\r
140#endif\r
141#ifdef EUSERS\r
142 inscode(d, ds, de, "EUSERS", EUSERS, "Too many users");\r
143#else\r
144#ifdef WSAEUSERS\r
145 inscode(d, ds, de, "EUSERS", WSAEUSERS, "Too many users");\r
146#endif\r
147#endif\r
148#ifdef ENOTEMPTY\r
149 inscode(d, ds, de, "ENOTEMPTY", ENOTEMPTY, "Directory not empty");\r
150#else\r
151#ifdef WSAENOTEMPTY\r
152 inscode(d, ds, de, "ENOTEMPTY", WSAENOTEMPTY, "Directory not empty");\r
153#endif\r
154#endif\r
155#ifdef ENOBUFS\r
156 inscode(d, ds, de, "ENOBUFS", ENOBUFS, "No buffer space available");\r
157#else\r
158#ifdef WSAENOBUFS\r
159 inscode(d, ds, de, "ENOBUFS", WSAENOBUFS, "No buffer space available");\r
160#endif\r
161#endif\r
162#ifdef EPROTO\r
163 inscode(d, ds, de, "EPROTO", EPROTO, "Protocol error");\r
164#endif\r
165#ifdef EREMOTE\r
166 inscode(d, ds, de, "EREMOTE", EREMOTE, "Object is remote");\r
167#else\r
168#ifdef WSAEREMOTE\r
169 inscode(d, ds, de, "EREMOTE", WSAEREMOTE, "Object is remote");\r
170#endif\r
171#endif\r
172#ifdef ENAVAIL\r
173 inscode(d, ds, de, "ENAVAIL", ENAVAIL, "No XENIX semaphores available");\r
174#endif\r
175#ifdef ECHILD\r
176 inscode(d, ds, de, "ECHILD", ECHILD, "No child processes");\r
177#endif\r
178#ifdef ELOOP\r
179 inscode(d, ds, de, "ELOOP", ELOOP, "Too many symbolic links encountered");\r
180#else\r
181#ifdef WSAELOOP\r
182 inscode(d, ds, de, "ELOOP", WSAELOOP, "Too many symbolic links encountered");\r
183#endif\r
184#endif\r
185#ifdef EXDEV\r
186 inscode(d, ds, de, "EXDEV", EXDEV, "Cross-device link");\r
187#endif\r
188#ifdef E2BIG\r
189 inscode(d, ds, de, "E2BIG", E2BIG, "Arg list too long");\r
190#endif\r
191#ifdef ESRCH\r
192 inscode(d, ds, de, "ESRCH", ESRCH, "No such process");\r
193#endif\r
194#ifdef EMSGSIZE\r
195 inscode(d, ds, de, "EMSGSIZE", EMSGSIZE, "Message too long");\r
196#else\r
197#ifdef WSAEMSGSIZE\r
198 inscode(d, ds, de, "EMSGSIZE", WSAEMSGSIZE, "Message too long");\r
199#endif\r
200#endif\r
201#ifdef EAFNOSUPPORT\r
202 inscode(d, ds, de, "EAFNOSUPPORT", EAFNOSUPPORT, "Address family not supported by protocol");\r
203#else\r
204#ifdef WSAEAFNOSUPPORT\r
205 inscode(d, ds, de, "EAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");\r
206#endif\r
207#endif\r
208#ifdef EBADR\r
209 inscode(d, ds, de, "EBADR", EBADR, "Invalid request descriptor");\r
210#endif\r
211#ifdef EHOSTDOWN\r
212 inscode(d, ds, de, "EHOSTDOWN", EHOSTDOWN, "Host is down");\r
213#else\r
214#ifdef WSAEHOSTDOWN\r
215 inscode(d, ds, de, "EHOSTDOWN", WSAEHOSTDOWN, "Host is down");\r
216#endif\r
217#endif\r
218#ifdef EPFNOSUPPORT\r
219 inscode(d, ds, de, "EPFNOSUPPORT", EPFNOSUPPORT, "Protocol family not supported");\r
220#else\r
221#ifdef WSAEPFNOSUPPORT\r
222 inscode(d, ds, de, "EPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");\r
223#endif\r
224#endif\r
225#ifdef ENOPROTOOPT\r
226 inscode(d, ds, de, "ENOPROTOOPT", ENOPROTOOPT, "Protocol not available");\r
227#else\r
228#ifdef WSAENOPROTOOPT\r
229 inscode(d, ds, de, "ENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");\r
230#endif\r
231#endif\r
232#ifdef EBUSY\r
233 inscode(d, ds, de, "EBUSY", EBUSY, "Device or resource busy");\r
234#endif\r
235#ifdef EWOULDBLOCK\r
236 inscode(d, ds, de, "EWOULDBLOCK", EWOULDBLOCK, "Operation would block");\r
237#else\r
238#ifdef WSAEWOULDBLOCK\r
239 inscode(d, ds, de, "EWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");\r
240#endif\r
241#endif\r
242#ifdef EBADFD\r
243 inscode(d, ds, de, "EBADFD", EBADFD, "File descriptor in bad state");\r
244#endif\r
245#ifdef EDOTDOT\r
246 inscode(d, ds, de, "EDOTDOT", EDOTDOT, "RFS specific error");\r
247#endif\r
248#ifdef EISCONN\r
249 inscode(d, ds, de, "EISCONN", EISCONN, "Transport endpoint is already connected");\r
250#else\r
251#ifdef WSAEISCONN\r
252 inscode(d, ds, de, "EISCONN", WSAEISCONN, "Transport endpoint is already connected");\r
253#endif\r
254#endif\r
255#ifdef ENOANO\r
256 inscode(d, ds, de, "ENOANO", ENOANO, "No anode");\r
257#endif\r
258#ifdef ESHUTDOWN\r
259 inscode(d, ds, de, "ESHUTDOWN", ESHUTDOWN, "Cannot send after transport endpoint shutdown");\r
260#else\r
261#ifdef WSAESHUTDOWN\r
262 inscode(d, ds, de, "ESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");\r
263#endif\r
264#endif\r
265#ifdef ECHRNG\r
266 inscode(d, ds, de, "ECHRNG", ECHRNG, "Channel number out of range");\r
267#endif\r
268#ifdef ELIBBAD\r
269 inscode(d, ds, de, "ELIBBAD", ELIBBAD, "Accessing a corrupted shared library");\r
270#endif\r
271#ifdef ENONET\r
272 inscode(d, ds, de, "ENONET", ENONET, "Machine is not on the network");\r
273#endif\r
274#ifdef EBADE\r
275 inscode(d, ds, de, "EBADE", EBADE, "Invalid exchange");\r
276#endif\r
277#ifdef EBADF\r
278 inscode(d, ds, de, "EBADF", EBADF, "Bad file number");\r
279#else\r
280#ifdef WSAEBADF\r
281 inscode(d, ds, de, "EBADF", WSAEBADF, "Bad file number");\r
282#endif\r
283#endif\r
284#ifdef EMULTIHOP\r
285 inscode(d, ds, de, "EMULTIHOP", EMULTIHOP, "Multihop attempted");\r
286#endif\r
287#ifdef EIO\r
288 inscode(d, ds, de, "EIO", EIO, "I/O error");\r
289#endif\r
290#ifdef EUNATCH\r
291 inscode(d, ds, de, "EUNATCH", EUNATCH, "Protocol driver not attached");\r
292#endif\r
293#ifdef EPROTOTYPE\r
294 inscode(d, ds, de, "EPROTOTYPE", EPROTOTYPE, "Protocol wrong type for socket");\r
295#else\r
296#ifdef WSAEPROTOTYPE\r
297 inscode(d, ds, de, "EPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");\r
298#endif\r
299#endif\r
300#ifdef ENOSPC\r
301 inscode(d, ds, de, "ENOSPC", ENOSPC, "No space left on device");\r
302#endif\r
303#ifdef ENOEXEC\r
304 inscode(d, ds, de, "ENOEXEC", ENOEXEC, "Exec format error");\r
305#endif\r
306#ifdef EALREADY\r
307 inscode(d, ds, de, "EALREADY", EALREADY, "Operation already in progress");\r
308#else\r
309#ifdef WSAEALREADY\r
310 inscode(d, ds, de, "EALREADY", WSAEALREADY, "Operation already in progress");\r
311#endif\r
312#endif\r
313#ifdef ENETDOWN\r
314 inscode(d, ds, de, "ENETDOWN", ENETDOWN, "Network is down");\r
315#else\r
316#ifdef WSAENETDOWN\r
317 inscode(d, ds, de, "ENETDOWN", WSAENETDOWN, "Network is down");\r
318#endif\r
319#endif\r
320#ifdef ENOTNAM\r
321 inscode(d, ds, de, "ENOTNAM", ENOTNAM, "Not a XENIX named type file");\r
322#endif\r
323#ifdef EACCES\r
324 inscode(d, ds, de, "EACCES", EACCES, "Permission denied");\r
325#else\r
326#ifdef WSAEACCES\r
327 inscode(d, ds, de, "EACCES", WSAEACCES, "Permission denied");\r
328#endif\r
329#endif\r
330#ifdef ELNRNG\r
331 inscode(d, ds, de, "ELNRNG", ELNRNG, "Link number out of range");\r
332#endif\r
333#ifdef EILSEQ\r
334 inscode(d, ds, de, "EILSEQ", EILSEQ, "Illegal byte sequence");\r
335#endif\r
336#ifdef ENOTDIR\r
337 inscode(d, ds, de, "ENOTDIR", ENOTDIR, "Not a directory");\r
338#endif\r
339#ifdef ENOTUNIQ\r
340 inscode(d, ds, de, "ENOTUNIQ", ENOTUNIQ, "Name not unique on network");\r
341#endif\r
342#ifdef EPERM\r
343 inscode(d, ds, de, "EPERM", EPERM, "Operation not permitted");\r
344#endif\r
345#ifdef EDOM\r
346 inscode(d, ds, de, "EDOM", EDOM, "Math argument out of domain of func");\r
347#endif\r
348#ifdef EXFULL\r
349 inscode(d, ds, de, "EXFULL", EXFULL, "Exchange full");\r
350#endif\r
351#ifdef ECONNREFUSED\r
352 inscode(d, ds, de, "ECONNREFUSED", ECONNREFUSED, "Connection refused");\r
353#else\r
354#ifdef WSAECONNREFUSED\r
355 inscode(d, ds, de, "ECONNREFUSED", WSAECONNREFUSED, "Connection refused");\r
356#endif\r
357#endif\r
358#ifdef EISDIR\r
359 inscode(d, ds, de, "EISDIR", EISDIR, "Is a directory");\r
360#endif\r
361#ifdef EPROTONOSUPPORT\r
362 inscode(d, ds, de, "EPROTONOSUPPORT", EPROTONOSUPPORT, "Protocol not supported");\r
363#else\r
364#ifdef WSAEPROTONOSUPPORT\r
365 inscode(d, ds, de, "EPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");\r
366#endif\r
367#endif\r
368#ifdef EROFS\r
369 inscode(d, ds, de, "EROFS", EROFS, "Read-only file system");\r
370#endif\r
371#ifdef EADDRNOTAVAIL\r
372 inscode(d, ds, de, "EADDRNOTAVAIL", EADDRNOTAVAIL, "Cannot assign requested address");\r
373#else\r
374#ifdef WSAEADDRNOTAVAIL\r
375 inscode(d, ds, de, "EADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");\r
376#endif\r
377#endif\r
378#ifdef EIDRM\r
379 inscode(d, ds, de, "EIDRM", EIDRM, "Identifier removed");\r
380#endif\r
381#ifdef ECOMM\r
382 inscode(d, ds, de, "ECOMM", ECOMM, "Communication error on send");\r
383#endif\r
384#ifdef ESRMNT\r
385 inscode(d, ds, de, "ESRMNT", ESRMNT, "Srmount error");\r
386#endif\r
387#ifdef EREMOTEIO\r
388 inscode(d, ds, de, "EREMOTEIO", EREMOTEIO, "Remote I/O error");\r
389#endif\r
390#ifdef EL3RST\r
391 inscode(d, ds, de, "EL3RST", EL3RST, "Level 3 reset");\r
392#endif\r
393#ifdef EBADMSG\r
394 inscode(d, ds, de, "EBADMSG", EBADMSG, "Not a data message");\r
395#endif\r
396#ifdef ENFILE\r
397 inscode(d, ds, de, "ENFILE", ENFILE, "File table overflow");\r
398#endif\r
399#ifdef ELIBMAX\r
400 inscode(d, ds, de, "ELIBMAX", ELIBMAX, "Attempting to link in too many shared libraries");\r
401#endif\r
402#ifdef ESPIPE\r
403 inscode(d, ds, de, "ESPIPE", ESPIPE, "Illegal seek");\r
404#endif\r
405#ifdef ENOLINK\r
406 inscode(d, ds, de, "ENOLINK", ENOLINK, "Link has been severed");\r
407#endif\r
408#ifdef ENETRESET\r
409 inscode(d, ds, de, "ENETRESET", ENETRESET, "Network dropped connection because of reset");\r
410#else\r
411#ifdef WSAENETRESET\r
412 inscode(d, ds, de, "ENETRESET", WSAENETRESET, "Network dropped connection because of reset");\r
413#endif\r
414#endif\r
415#ifdef ETIMEDOUT\r
416 inscode(d, ds, de, "ETIMEDOUT", ETIMEDOUT, "Connection timed out");\r
417#else\r
418#ifdef WSAETIMEDOUT\r
419 inscode(d, ds, de, "ETIMEDOUT", WSAETIMEDOUT, "Connection timed out");\r
420#endif\r
421#endif\r
422#ifdef ENOENT\r
423 inscode(d, ds, de, "ENOENT", ENOENT, "No such file or directory");\r
424#endif\r
425#ifdef EEXIST\r
426 inscode(d, ds, de, "EEXIST", EEXIST, "File exists");\r
427#endif\r
428#ifdef EDQUOT\r
429 inscode(d, ds, de, "EDQUOT", EDQUOT, "Quota exceeded");\r
430#else\r
431#ifdef WSAEDQUOT\r
432 inscode(d, ds, de, "EDQUOT", WSAEDQUOT, "Quota exceeded");\r
433#endif\r
434#endif\r
435#ifdef ENOSTR\r
436 inscode(d, ds, de, "ENOSTR", ENOSTR, "Device not a stream");\r
437#endif\r
438#ifdef EBADSLT\r
439 inscode(d, ds, de, "EBADSLT", EBADSLT, "Invalid slot");\r
440#endif\r
441#ifdef EBADRQC\r
442 inscode(d, ds, de, "EBADRQC", EBADRQC, "Invalid request code");\r
443#endif\r
444#ifdef ELIBACC\r
445 inscode(d, ds, de, "ELIBACC", ELIBACC, "Can not access a needed shared library");\r
446#endif\r
447#ifdef EFAULT\r
448 inscode(d, ds, de, "EFAULT", EFAULT, "Bad address");\r
449#else\r
450#ifdef WSAEFAULT\r
451 inscode(d, ds, de, "EFAULT", WSAEFAULT, "Bad address");\r
452#endif\r
453#endif\r
454#ifdef EFBIG\r
455 inscode(d, ds, de, "EFBIG", EFBIG, "File too large");\r
456#endif\r
457#ifdef EDEADLK\r
458 inscode(d, ds, de, "EDEADLK", EDEADLK, "Resource deadlock would occur");\r
459#endif\r
460#ifdef ENOTCONN\r
461 inscode(d, ds, de, "ENOTCONN", ENOTCONN, "Transport endpoint is not connected");\r
462#else\r
463#ifdef WSAENOTCONN\r
464 inscode(d, ds, de, "ENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");\r
465#endif\r
466#endif\r
467#ifdef EDESTADDRREQ\r
468 inscode(d, ds, de, "EDESTADDRREQ", EDESTADDRREQ, "Destination address required");\r
469#else\r
470#ifdef WSAEDESTADDRREQ\r
471 inscode(d, ds, de, "EDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");\r
472#endif\r
473#endif\r
474#ifdef ELIBSCN\r
475 inscode(d, ds, de, "ELIBSCN", ELIBSCN, ".lib section in a.out corrupted");\r
476#endif\r
477#ifdef ENOLCK\r
478 inscode(d, ds, de, "ENOLCK", ENOLCK, "No record locks available");\r
479#endif\r
480#ifdef EISNAM\r
481 inscode(d, ds, de, "EISNAM", EISNAM, "Is a named type file");\r
482#endif\r
483#ifdef ECONNABORTED\r
484 inscode(d, ds, de, "ECONNABORTED", ECONNABORTED, "Software caused connection abort");\r
485#else\r
486#ifdef WSAECONNABORTED\r
487 inscode(d, ds, de, "ECONNABORTED", WSAECONNABORTED, "Software caused connection abort");\r
488#endif\r
489#endif\r
490#ifdef ENETUNREACH\r
491 inscode(d, ds, de, "ENETUNREACH", ENETUNREACH, "Network is unreachable");\r
492#else\r
493#ifdef WSAENETUNREACH\r
494 inscode(d, ds, de, "ENETUNREACH", WSAENETUNREACH, "Network is unreachable");\r
495#endif\r
496#endif\r
497#ifdef ESTALE\r
498 inscode(d, ds, de, "ESTALE", ESTALE, "Stale NFS file handle");\r
499#else\r
500#ifdef WSAESTALE\r
501 inscode(d, ds, de, "ESTALE", WSAESTALE, "Stale NFS file handle");\r
502#endif\r
503#endif\r
504#ifdef ENOSR\r
505 inscode(d, ds, de, "ENOSR", ENOSR, "Out of streams resources");\r
506#endif\r
507#ifdef ENOMEM\r
508 inscode(d, ds, de, "ENOMEM", ENOMEM, "Out of memory");\r
509#endif\r
510#ifdef ENOTSOCK\r
511 inscode(d, ds, de, "ENOTSOCK", ENOTSOCK, "Socket operation on non-socket");\r
512#else\r
513#ifdef WSAENOTSOCK\r
514 inscode(d, ds, de, "ENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");\r
515#endif\r
516#endif\r
517#ifdef ESTRPIPE\r
518 inscode(d, ds, de, "ESTRPIPE", ESTRPIPE, "Streams pipe error");\r
519#endif\r
520#ifdef EMLINK\r
521 inscode(d, ds, de, "EMLINK", EMLINK, "Too many links");\r
522#endif\r
523#ifdef ERANGE\r
524 inscode(d, ds, de, "ERANGE", ERANGE, "Math result not representable");\r
525#endif\r
526#ifdef ELIBEXEC\r
527 inscode(d, ds, de, "ELIBEXEC", ELIBEXEC, "Cannot exec a shared library directly");\r
528#endif\r
529#ifdef EL3HLT\r
530 inscode(d, ds, de, "EL3HLT", EL3HLT, "Level 3 halted");\r
531#endif\r
532#ifdef ECONNRESET\r
533 inscode(d, ds, de, "ECONNRESET", ECONNRESET, "Connection reset by peer");\r
534#else\r
535#ifdef WSAECONNRESET\r
536 inscode(d, ds, de, "ECONNRESET", WSAECONNRESET, "Connection reset by peer");\r
537#endif\r
538#endif\r
539#ifdef EADDRINUSE\r
540 inscode(d, ds, de, "EADDRINUSE", EADDRINUSE, "Address already in use");\r
541#else\r
542#ifdef WSAEADDRINUSE\r
543 inscode(d, ds, de, "EADDRINUSE", WSAEADDRINUSE, "Address already in use");\r
544#endif\r
545#endif\r
546#ifdef EOPNOTSUPP\r
547 inscode(d, ds, de, "EOPNOTSUPP", EOPNOTSUPP, "Operation not supported on transport endpoint");\r
548#else\r
549#ifdef WSAEOPNOTSUPP\r
550 inscode(d, ds, de, "EOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");\r
551#endif\r
552#endif\r
553#ifdef EREMCHG\r
554 inscode(d, ds, de, "EREMCHG", EREMCHG, "Remote address changed");\r
555#endif\r
556#ifdef EAGAIN\r
557 inscode(d, ds, de, "EAGAIN", EAGAIN, "Try again");\r
558#endif\r
559#ifdef ENAMETOOLONG\r
560 inscode(d, ds, de, "ENAMETOOLONG", ENAMETOOLONG, "File name too long");\r
561#else\r
562#ifdef WSAENAMETOOLONG\r
563 inscode(d, ds, de, "ENAMETOOLONG", WSAENAMETOOLONG, "File name too long");\r
564#endif\r
565#endif\r
566#ifdef ENOTTY\r
567 inscode(d, ds, de, "ENOTTY", ENOTTY, "Not a typewriter");\r
568#endif\r
569#ifdef ERESTART\r
570 inscode(d, ds, de, "ERESTART", ERESTART, "Interrupted system call should be restarted");\r
571#endif\r
572#ifdef ESOCKTNOSUPPORT\r
573 inscode(d, ds, de, "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, "Socket type not supported");\r
574#else\r
575#ifdef WSAESOCKTNOSUPPORT\r
576 inscode(d, ds, de, "ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");\r
577#endif\r
578#endif\r
579#ifdef ETIME\r
580 inscode(d, ds, de, "ETIME", ETIME, "Timer expired");\r
581#endif\r
582#ifdef EBFONT\r
583 inscode(d, ds, de, "EBFONT", EBFONT, "Bad font file format");\r
584#endif\r
585#ifdef EDEADLOCK\r
586 inscode(d, ds, de, "EDEADLOCK", EDEADLOCK, "Error EDEADLOCK");\r
587#endif\r
588#ifdef ETOOMANYREFS\r
589 inscode(d, ds, de, "ETOOMANYREFS", ETOOMANYREFS, "Too many references: cannot splice");\r
590#else\r
591#ifdef WSAETOOMANYREFS\r
592 inscode(d, ds, de, "ETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");\r
593#endif\r
594#endif\r
595#ifdef EMFILE\r
596 inscode(d, ds, de, "EMFILE", EMFILE, "Too many open files");\r
597#else\r
598#ifdef WSAEMFILE\r
599 inscode(d, ds, de, "EMFILE", WSAEMFILE, "Too many open files");\r
600#endif\r
601#endif\r
602#ifdef ETXTBSY\r
603 inscode(d, ds, de, "ETXTBSY", ETXTBSY, "Text file busy");\r
604#endif\r
605#ifdef EINPROGRESS\r
606 inscode(d, ds, de, "EINPROGRESS", EINPROGRESS, "Operation now in progress");\r
607#else\r
608#ifdef WSAEINPROGRESS\r
609 inscode(d, ds, de, "EINPROGRESS", WSAEINPROGRESS, "Operation now in progress");\r
610#endif\r
611#endif\r
612#ifdef ENXIO\r
613 inscode(d, ds, de, "ENXIO", ENXIO, "No such device or address");\r
614#endif\r
615#ifdef ENOPKG\r
616 inscode(d, ds, de, "ENOPKG", ENOPKG, "Package not installed");\r
617#endif\r
618#ifdef WSASY\r
619 inscode(d, ds, de, "WSASY", WSASY, "Error WSASY");\r
620#endif\r
621#ifdef WSAEHOSTDOWN\r
622 inscode(d, ds, de, "WSAEHOSTDOWN", WSAEHOSTDOWN, "Host is down");\r
623#endif\r
624#ifdef WSAENETDOWN\r
625 inscode(d, ds, de, "WSAENETDOWN", WSAENETDOWN, "Network is down");\r
626#endif\r
627#ifdef WSAENOTSOCK\r
628 inscode(d, ds, de, "WSAENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");\r
629#endif\r
630#ifdef WSAEHOSTUNREACH\r
631 inscode(d, ds, de, "WSAEHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");\r
632#endif\r
633#ifdef WSAELOOP\r
634 inscode(d, ds, de, "WSAELOOP", WSAELOOP, "Too many symbolic links encountered");\r
635#endif\r
636#ifdef WSAEMFILE\r
637 inscode(d, ds, de, "WSAEMFILE", WSAEMFILE, "Too many open files");\r
638#endif\r
639#ifdef WSAESTALE\r
640 inscode(d, ds, de, "WSAESTALE", WSAESTALE, "Stale NFS file handle");\r
641#endif\r
642#ifdef WSAVERNOTSUPPORTED\r
643 inscode(d, ds, de, "WSAVERNOTSUPPORTED", WSAVERNOTSUPPORTED, "Error WSAVERNOTSUPPORTED");\r
644#endif\r
645#ifdef WSAENETUNREACH\r
646 inscode(d, ds, de, "WSAENETUNREACH", WSAENETUNREACH, "Network is unreachable");\r
647#endif\r
648#ifdef WSAEPROCLIM\r
649 inscode(d, ds, de, "WSAEPROCLIM", WSAEPROCLIM, "Error WSAEPROCLIM");\r
650#endif\r
651#ifdef WSAEFAULT\r
652 inscode(d, ds, de, "WSAEFAULT", WSAEFAULT, "Bad address");\r
653#endif\r
654#ifdef WSANOTINITIALISED\r
655 inscode(d, ds, de, "WSANOTINITIALISED", WSANOTINITIALISED, "Error WSANOTINITIALISED");\r
656#endif\r
657#ifdef WSAEUSERS\r
658 inscode(d, ds, de, "WSAEUSERS", WSAEUSERS, "Too many users");\r
659#endif\r
660#ifdef WSAMAKEASYNCREPL\r
661 inscode(d, ds, de, "WSAMAKEASYNCREPL", WSAMAKEASYNCREPL, "Error WSAMAKEASYNCREPL");\r
662#endif\r
663#ifdef WSAENOPROTOOPT\r
664 inscode(d, ds, de, "WSAENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");\r
665#endif\r
666#ifdef WSAECONNABORTED\r
667 inscode(d, ds, de, "WSAECONNABORTED", WSAECONNABORTED, "Software caused connection abort");\r
668#endif\r
669#ifdef WSAENAMETOOLONG\r
670 inscode(d, ds, de, "WSAENAMETOOLONG", WSAENAMETOOLONG, "File name too long");\r
671#endif\r
672#ifdef WSAENOTEMPTY\r
673 inscode(d, ds, de, "WSAENOTEMPTY", WSAENOTEMPTY, "Directory not empty");\r
674#endif\r
675#ifdef WSAESHUTDOWN\r
676 inscode(d, ds, de, "WSAESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");\r
677#endif\r
678#ifdef WSAEAFNOSUPPORT\r
679 inscode(d, ds, de, "WSAEAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");\r
680#endif\r
681#ifdef WSAETOOMANYREFS\r
682 inscode(d, ds, de, "WSAETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");\r
683#endif\r
684#ifdef WSAEACCES\r
685 inscode(d, ds, de, "WSAEACCES", WSAEACCES, "Permission denied");\r
686#endif\r
687#ifdef WSATR\r
688 inscode(d, ds, de, "WSATR", WSATR, "Error WSATR");\r
689#endif\r
690#ifdef WSABASEERR\r
691 inscode(d, ds, de, "WSABASEERR", WSABASEERR, "Error WSABASEERR");\r
692#endif\r
693#ifdef WSADESCRIPTIO\r
694 inscode(d, ds, de, "WSADESCRIPTIO", WSADESCRIPTIO, "Error WSADESCRIPTIO");\r
695#endif\r
696#ifdef WSAEMSGSIZE\r
697 inscode(d, ds, de, "WSAEMSGSIZE", WSAEMSGSIZE, "Message too long");\r
698#endif\r
699#ifdef WSAEBADF\r
700 inscode(d, ds, de, "WSAEBADF", WSAEBADF, "Bad file number");\r
701#endif\r
702#ifdef WSAECONNRESET\r
703 inscode(d, ds, de, "WSAECONNRESET", WSAECONNRESET, "Connection reset by peer");\r
704#endif\r
705#ifdef WSAGETSELECTERRO\r
706 inscode(d, ds, de, "WSAGETSELECTERRO", WSAGETSELECTERRO, "Error WSAGETSELECTERRO");\r
707#endif\r
708#ifdef WSAETIMEDOUT\r
709 inscode(d, ds, de, "WSAETIMEDOUT", WSAETIMEDOUT, "Connection timed out");\r
710#endif\r
711#ifdef WSAENOBUFS\r
712 inscode(d, ds, de, "WSAENOBUFS", WSAENOBUFS, "No buffer space available");\r
713#endif\r
714#ifdef WSAEDISCON\r
715 inscode(d, ds, de, "WSAEDISCON", WSAEDISCON, "Error WSAEDISCON");\r
716#endif\r
717#ifdef WSAEINTR\r
718 inscode(d, ds, de, "WSAEINTR", WSAEINTR, "Interrupted system call");\r
719#endif\r
720#ifdef WSAEPROTOTYPE\r
721 inscode(d, ds, de, "WSAEPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");\r
722#endif\r
723#ifdef WSAHOS\r
724 inscode(d, ds, de, "WSAHOS", WSAHOS, "Error WSAHOS");\r
725#endif\r
726#ifdef WSAEADDRINUSE\r
727 inscode(d, ds, de, "WSAEADDRINUSE", WSAEADDRINUSE, "Address already in use");\r
728#endif\r
729#ifdef WSAEADDRNOTAVAIL\r
730 inscode(d, ds, de, "WSAEADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");\r
731#endif\r
732#ifdef WSAEALREADY\r
733 inscode(d, ds, de, "WSAEALREADY", WSAEALREADY, "Operation already in progress");\r
734#endif\r
735#ifdef WSAEPROTONOSUPPORT\r
736 inscode(d, ds, de, "WSAEPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");\r
737#endif\r
738#ifdef WSASYSNOTREADY\r
739 inscode(d, ds, de, "WSASYSNOTREADY", WSASYSNOTREADY, "Error WSASYSNOTREADY");\r
740#endif\r
741#ifdef WSAEWOULDBLOCK\r
742 inscode(d, ds, de, "WSAEWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");\r
743#endif\r
744#ifdef WSAEPFNOSUPPORT\r
745 inscode(d, ds, de, "WSAEPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");\r
746#endif\r
747#ifdef WSAEOPNOTSUPP\r
748 inscode(d, ds, de, "WSAEOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");\r
749#endif\r
750#ifdef WSAEISCONN\r
751 inscode(d, ds, de, "WSAEISCONN", WSAEISCONN, "Transport endpoint is already connected");\r
752#endif\r
753#ifdef WSAEDQUOT\r
754 inscode(d, ds, de, "WSAEDQUOT", WSAEDQUOT, "Quota exceeded");\r
755#endif\r
756#ifdef WSAENOTCONN\r
757 inscode(d, ds, de, "WSAENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");\r
758#endif\r
759#ifdef WSAEREMOTE\r
760 inscode(d, ds, de, "WSAEREMOTE", WSAEREMOTE, "Object is remote");\r
761#endif\r
762#ifdef WSAEINVAL\r
763 inscode(d, ds, de, "WSAEINVAL", WSAEINVAL, "Invalid argument");\r
764#endif\r
765#ifdef WSAEINPROGRESS\r
766 inscode(d, ds, de, "WSAEINPROGRESS", WSAEINPROGRESS, "Operation now in progress");\r
767#endif\r
768#ifdef WSAGETSELECTEVEN\r
769 inscode(d, ds, de, "WSAGETSELECTEVEN", WSAGETSELECTEVEN, "Error WSAGETSELECTEVEN");\r
770#endif\r
771#ifdef WSAESOCKTNOSUPPORT\r
772 inscode(d, ds, de, "WSAESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");\r
773#endif\r
774#ifdef WSAGETASYNCERRO\r
775 inscode(d, ds, de, "WSAGETASYNCERRO", WSAGETASYNCERRO, "Error WSAGETASYNCERRO");\r
776#endif\r
777#ifdef WSAMAKESELECTREPL\r
778 inscode(d, ds, de, "WSAMAKESELECTREPL", WSAMAKESELECTREPL, "Error WSAMAKESELECTREPL");\r
779#endif\r
780#ifdef WSAGETASYNCBUFLE\r
781 inscode(d, ds, de, "WSAGETASYNCBUFLE", WSAGETASYNCBUFLE, "Error WSAGETASYNCBUFLE");\r
782#endif\r
783#ifdef WSAEDESTADDRREQ\r
784 inscode(d, ds, de, "WSAEDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");\r
785#endif\r
786#ifdef WSAECONNREFUSED\r
787 inscode(d, ds, de, "WSAECONNREFUSED", WSAECONNREFUSED, "Connection refused");\r
788#endif\r
789#ifdef WSAENETRESET\r
790 inscode(d, ds, de, "WSAENETRESET", WSAENETRESET, "Network dropped connection because of reset");\r
791#endif\r
792#ifdef WSAN\r
793 inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");\r
794#endif\r
d11973f1
DM
795\r
796/* These symbols are added for EDK II support. */\r
797#ifdef EMINERRORVAL\r
798 inscode(d, ds, de, "EMINERRORVAL", EMINERRORVAL, "Lowest valid error value");\r
799#endif\r
3ec97ca4 800#ifdef ENOTSUP\r
d11973f1
DM
801 inscode(d, ds, de, "ENOTSUP", ENOTSUP, "Operation not supported");\r
802#endif\r
803#ifdef EBADRPC\r
804 inscode(d, ds, de, "EBADRPC", EBADRPC, "RPC struct is bad");\r
805#endif\r
806#ifdef ERPCMISMATCH\r
807 inscode(d, ds, de, "ERPCMISMATCH", ERPCMISMATCH, "RPC version wrong");\r
808#endif\r
809#ifdef EPROGUNAVAIL\r
810 inscode(d, ds, de, "EPROGUNAVAIL", EPROGUNAVAIL, "RPC prog. not avail");\r
811#endif\r
812#ifdef EPROGMISMATCH\r
813 inscode(d, ds, de, "EPROGMISMATCH", EPROGMISMATCH, "Program version wrong");\r
814#endif\r
815#ifdef EPROCUNAVAIL\r
816 inscode(d, ds, de, "EPROCUNAVAIL", EPROCUNAVAIL, "Bad procedure for program");\r
817#endif\r
818#ifdef EFTYPE\r
819 inscode(d, ds, de, "EFTYPE", EFTYPE, "Inappropriate file type or format");\r
820#endif\r
821#ifdef EAUTH\r
822 inscode(d, ds, de, "EAUTH", EAUTH, "Authentication error");\r
823#endif\r
824#ifdef ENEEDAUTH\r
825 inscode(d, ds, de, "ENEEDAUTH", ENEEDAUTH, "Need authenticator");\r
826#endif\r
827#ifdef ECANCELED\r
828 inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation canceled");\r
829#endif\r
830#ifdef ENOATTR\r
831 inscode(d, ds, de, "ENOATTR", ENOATTR, "Attribute not found");\r
832#endif\r
833#ifdef EDOOFUS\r
834 inscode(d, ds, de, "EDOOFUS", EDOOFUS, "Programming Error");\r
835#endif\r
836#ifdef EBUFSIZE\r
837 inscode(d, ds, de, "EBUFSIZE", EBUFSIZE, "Buffer too small to hold result");\r
838#endif\r
839#ifdef EMAXERRORVAL\r
840 inscode(d, ds, de, "EMAXERRORVAL", EMAXERRORVAL, "One more than the highest defined error value");\r
3ec97ca4
DM
841#endif\r
842\r
843 Py_DECREF(de);\r
844}\r