blob: 68c3c492dbb104ee177ecb46a58d0e7a30757c08 [file] [log] [blame]
Guido van Rossum4dc66221996-07-24 00:51:51 +00001
2/* Errno module */
3
4#include "Python.h"
5
Tim Peters902952b2002-01-26 17:58:02 +00006/* Windows socket errors (WSA*) */
Guido van Rossum49f9d8e1997-09-28 05:41:56 +00007#ifdef MS_WINDOWS
Amaury Forgeot d'Arca4dd2e22008-06-13 00:42:22 +00008#include <windows.h>
Guido van Rossum49f9d8e1997-09-28 05:41:56 +00009#endif
10
Guido van Rossum4dc66221996-07-24 00:51:51 +000011/*
12 * Pull in the system error definitions
Antoine Pitrouc83ea132010-05-09 14:46:46 +000013 */
Guido van Rossum4dc66221996-07-24 00:51:51 +000014
Guido van Rossum4dc66221996-07-24 00:51:51 +000015static PyMethodDef errno_methods[] = {
Antoine Pitrouc83ea132010-05-09 14:46:46 +000016 {NULL, NULL}
Guido van Rossum4dc66221996-07-24 00:51:51 +000017};
18
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000019/* Helper function doing the dictionary inserting */
Guido van Rossum4dc66221996-07-24 00:51:51 +000020
21static void
Fredrik Lundhf5accf32000-07-09 15:14:52 +000022_inscode(PyObject *d, PyObject *de, char *name, int code)
Guido van Rossum4dc66221996-07-24 00:51:51 +000023{
Antoine Pitrouc83ea132010-05-09 14:46:46 +000024 PyObject *u = PyString_FromString(name);
25 PyObject *v = PyInt_FromLong((long) code);
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000026
Antoine Pitrouc83ea132010-05-09 14:46:46 +000027 /* Don't bother checking for errors; they'll be caught at the end
28 * of the module initialization function by the caller of
29 * initerrno().
30 */
31 if (u && v) {
32 /* insert in modules dict */
33 PyDict_SetItem(d, u, v);
34 /* insert in errorcode dict */
35 PyDict_SetItem(de, v, u);
36 }
37 Py_XDECREF(u);
38 Py_XDECREF(v);
Guido van Rossum4dc66221996-07-24 00:51:51 +000039}
40
Martin v. Löwis14f8b4c2002-06-13 20:33:02 +000041PyDoc_STRVAR(errno__doc__,
Guido van Rossum549cb6e1998-08-11 17:50:22 +000042"This module makes available standard errno system symbols.\n\
43\n\
44The value of each symbol is the corresponding integer value,\n\
45e.g., on most systems, errno.ENOENT equals the integer 2.\n\
46\n\
47The dictionary errno.errorcode maps numeric codes to symbol names,\n\
48e.g., errno.errorcode[2] could be the string 'ENOENT'.\n\
49\n\
50Symbols that are not relevant to the underlying system are not defined.\n\
51\n\
52To map error codes to error messages, use the function os.strerror(),\n\
Martin v. Löwis14f8b4c2002-06-13 20:33:02 +000053e.g. os.strerror(2) could return 'No such file or directory'.");
Guido van Rossum549cb6e1998-08-11 17:50:22 +000054
Mark Hammondfe51c6d2002-08-02 02:27:13 +000055PyMODINIT_FUNC
Thomas Woutersf3f33dc2000-07-21 06:00:07 +000056initerrno(void)
Guido van Rossum4dc66221996-07-24 00:51:51 +000057{
Antoine Pitrouc83ea132010-05-09 14:46:46 +000058 PyObject *m, *d, *de;
59 m = Py_InitModule3("errno", errno_methods, errno__doc__);
60 if (m == NULL)
61 return;
62 d = PyModule_GetDict(m);
63 de = PyDict_New();
64 if (!d || !de || PyDict_SetItemString(d, "errorcode", de) < 0)
65 return;
Guido van Rossum4dc66221996-07-24 00:51:51 +000066
Guido van Rossum851e7d51997-11-04 20:22:24 +000067/* Macro so I don't have to edit each and every line below... */
68#define inscode(d, ds, de, name, code, comment) _inscode(d, de, name, code)
69
Antoine Pitrouc83ea132010-05-09 14:46:46 +000070 /*
71 * The names and comments are borrowed from linux/include/errno.h,
72 * which should be pretty all-inclusive
73 */
Guido van Rossum4dc66221996-07-24 00:51:51 +000074
Guido van Rossum4dc66221996-07-24 00:51:51 +000075#ifdef ENODEV
Antoine Pitrouc83ea132010-05-09 14:46:46 +000076 inscode(d, ds, de, "ENODEV", ENODEV, "No such device");
Guido van Rossum4dc66221996-07-24 00:51:51 +000077#endif
78#ifdef ENOCSI
Antoine Pitrouc83ea132010-05-09 14:46:46 +000079 inscode(d, ds, de, "ENOCSI", ENOCSI, "No CSI structure available");
Guido van Rossum4dc66221996-07-24 00:51:51 +000080#endif
81#ifdef EHOSTUNREACH
Antoine Pitrouc83ea132010-05-09 14:46:46 +000082 inscode(d, ds, de, "EHOSTUNREACH", EHOSTUNREACH, "No route to host");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000083#else
84#ifdef WSAEHOSTUNREACH
Antoine Pitrouc83ea132010-05-09 14:46:46 +000085 inscode(d, ds, de, "EHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
Guido van Rossum4dc66221996-07-24 00:51:51 +000086#endif
Guido van Rossum4dc66221996-07-24 00:51:51 +000087#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000088#ifdef ENOMSG
Antoine Pitrouc83ea132010-05-09 14:46:46 +000089 inscode(d, ds, de, "ENOMSG", ENOMSG, "No message of desired type");
Guido van Rossum4dc66221996-07-24 00:51:51 +000090#endif
91#ifdef EUCLEAN
Antoine Pitrouc83ea132010-05-09 14:46:46 +000092 inscode(d, ds, de, "EUCLEAN", EUCLEAN, "Structure needs cleaning");
Guido van Rossum4dc66221996-07-24 00:51:51 +000093#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000094#ifdef EL2NSYNC
Antoine Pitrouc83ea132010-05-09 14:46:46 +000095 inscode(d, ds, de, "EL2NSYNC", EL2NSYNC, "Level 2 not synchronized");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000096#endif
97#ifdef EL2HLT
Antoine Pitrouc83ea132010-05-09 14:46:46 +000098 inscode(d, ds, de, "EL2HLT", EL2HLT, "Level 2 halted");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000099#endif
100#ifdef ENODATA
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000101 inscode(d, ds, de, "ENODATA", ENODATA, "No data available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000102#endif
103#ifdef ENOTBLK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000104 inscode(d, ds, de, "ENOTBLK", ENOTBLK, "Block device required");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000105#endif
106#ifdef ENOSYS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000107 inscode(d, ds, de, "ENOSYS", ENOSYS, "Function not implemented");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000108#endif
109#ifdef EPIPE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000110 inscode(d, ds, de, "EPIPE", EPIPE, "Broken pipe");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000111#endif
112#ifdef EINVAL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000113 inscode(d, ds, de, "EINVAL", EINVAL, "Invalid argument");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000114#else
115#ifdef WSAEINVAL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000116 inscode(d, ds, de, "EINVAL", WSAEINVAL, "Invalid argument");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000117#endif
118#endif
119#ifdef EOVERFLOW
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000120 inscode(d, ds, de, "EOVERFLOW", EOVERFLOW, "Value too large for defined data type");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000121#endif
122#ifdef EADV
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000123 inscode(d, ds, de, "EADV", EADV, "Advertise error");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000124#endif
125#ifdef EINTR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000126 inscode(d, ds, de, "EINTR", EINTR, "Interrupted system call");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000127#else
128#ifdef WSAEINTR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000129 inscode(d, ds, de, "EINTR", WSAEINTR, "Interrupted system call");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000130#endif
131#endif
132#ifdef EUSERS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000133 inscode(d, ds, de, "EUSERS", EUSERS, "Too many users");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000134#else
135#ifdef WSAEUSERS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000136 inscode(d, ds, de, "EUSERS", WSAEUSERS, "Too many users");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000137#endif
138#endif
139#ifdef ENOTEMPTY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000140 inscode(d, ds, de, "ENOTEMPTY", ENOTEMPTY, "Directory not empty");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000141#else
142#ifdef WSAENOTEMPTY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000143 inscode(d, ds, de, "ENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000144#endif
145#endif
146#ifdef ENOBUFS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000147 inscode(d, ds, de, "ENOBUFS", ENOBUFS, "No buffer space available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000148#else
149#ifdef WSAENOBUFS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000150 inscode(d, ds, de, "ENOBUFS", WSAENOBUFS, "No buffer space available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000151#endif
152#endif
153#ifdef EPROTO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000154 inscode(d, ds, de, "EPROTO", EPROTO, "Protocol error");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000155#endif
156#ifdef EREMOTE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000157 inscode(d, ds, de, "EREMOTE", EREMOTE, "Object is remote");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000158#else
159#ifdef WSAEREMOTE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000160 inscode(d, ds, de, "EREMOTE", WSAEREMOTE, "Object is remote");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000161#endif
Guido van Rossum4dc66221996-07-24 00:51:51 +0000162#endif
163#ifdef ENAVAIL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000164 inscode(d, ds, de, "ENAVAIL", ENAVAIL, "No XENIX semaphores available");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000165#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000166#ifdef ECHILD
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000167 inscode(d, ds, de, "ECHILD", ECHILD, "No child processes");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000168#endif
169#ifdef ELOOP
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000170 inscode(d, ds, de, "ELOOP", ELOOP, "Too many symbolic links encountered");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000171#else
172#ifdef WSAELOOP
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000173 inscode(d, ds, de, "ELOOP", WSAELOOP, "Too many symbolic links encountered");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000174#endif
175#endif
176#ifdef EXDEV
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000177 inscode(d, ds, de, "EXDEV", EXDEV, "Cross-device link");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000178#endif
179#ifdef E2BIG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000180 inscode(d, ds, de, "E2BIG", E2BIG, "Arg list too long");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000181#endif
182#ifdef ESRCH
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000183 inscode(d, ds, de, "ESRCH", ESRCH, "No such process");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000184#endif
185#ifdef EMSGSIZE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000186 inscode(d, ds, de, "EMSGSIZE", EMSGSIZE, "Message too long");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000187#else
188#ifdef WSAEMSGSIZE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000189 inscode(d, ds, de, "EMSGSIZE", WSAEMSGSIZE, "Message too long");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000190#endif
191#endif
192#ifdef EAFNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000193 inscode(d, ds, de, "EAFNOSUPPORT", EAFNOSUPPORT, "Address family not supported by protocol");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000194#else
195#ifdef WSAEAFNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000196 inscode(d, ds, de, "EAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000197#endif
198#endif
199#ifdef EBADR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000200 inscode(d, ds, de, "EBADR", EBADR, "Invalid request descriptor");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000201#endif
202#ifdef EHOSTDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000203 inscode(d, ds, de, "EHOSTDOWN", EHOSTDOWN, "Host is down");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000204#else
205#ifdef WSAEHOSTDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000206 inscode(d, ds, de, "EHOSTDOWN", WSAEHOSTDOWN, "Host is down");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000207#endif
208#endif
209#ifdef EPFNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000210 inscode(d, ds, de, "EPFNOSUPPORT", EPFNOSUPPORT, "Protocol family not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000211#else
212#ifdef WSAEPFNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000213 inscode(d, ds, de, "EPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000214#endif
215#endif
216#ifdef ENOPROTOOPT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000217 inscode(d, ds, de, "ENOPROTOOPT", ENOPROTOOPT, "Protocol not available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000218#else
219#ifdef WSAENOPROTOOPT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000220 inscode(d, ds, de, "ENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000221#endif
222#endif
223#ifdef EBUSY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000224 inscode(d, ds, de, "EBUSY", EBUSY, "Device or resource busy");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000225#endif
226#ifdef EWOULDBLOCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000227 inscode(d, ds, de, "EWOULDBLOCK", EWOULDBLOCK, "Operation would block");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000228#else
229#ifdef WSAEWOULDBLOCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000230 inscode(d, ds, de, "EWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000231#endif
232#endif
233#ifdef EBADFD
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000234 inscode(d, ds, de, "EBADFD", EBADFD, "File descriptor in bad state");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000235#endif
236#ifdef EDOTDOT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000237 inscode(d, ds, de, "EDOTDOT", EDOTDOT, "RFS specific error");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000238#endif
239#ifdef EISCONN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000240 inscode(d, ds, de, "EISCONN", EISCONN, "Transport endpoint is already connected");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000241#else
242#ifdef WSAEISCONN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000243 inscode(d, ds, de, "EISCONN", WSAEISCONN, "Transport endpoint is already connected");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000244#endif
245#endif
246#ifdef ENOANO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000247 inscode(d, ds, de, "ENOANO", ENOANO, "No anode");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000248#endif
249#ifdef ESHUTDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000250 inscode(d, ds, de, "ESHUTDOWN", ESHUTDOWN, "Cannot send after transport endpoint shutdown");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000251#else
252#ifdef WSAESHUTDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000253 inscode(d, ds, de, "ESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000254#endif
255#endif
256#ifdef ECHRNG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000257 inscode(d, ds, de, "ECHRNG", ECHRNG, "Channel number out of range");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000258#endif
259#ifdef ELIBBAD
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000260 inscode(d, ds, de, "ELIBBAD", ELIBBAD, "Accessing a corrupted shared library");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000261#endif
262#ifdef ENONET
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000263 inscode(d, ds, de, "ENONET", ENONET, "Machine is not on the network");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000264#endif
265#ifdef EBADE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000266 inscode(d, ds, de, "EBADE", EBADE, "Invalid exchange");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000267#endif
268#ifdef EBADF
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000269 inscode(d, ds, de, "EBADF", EBADF, "Bad file number");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000270#else
271#ifdef WSAEBADF
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000272 inscode(d, ds, de, "EBADF", WSAEBADF, "Bad file number");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000273#endif
274#endif
275#ifdef EMULTIHOP
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000276 inscode(d, ds, de, "EMULTIHOP", EMULTIHOP, "Multihop attempted");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000277#endif
278#ifdef EIO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000279 inscode(d, ds, de, "EIO", EIO, "I/O error");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000280#endif
281#ifdef EUNATCH
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000282 inscode(d, ds, de, "EUNATCH", EUNATCH, "Protocol driver not attached");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000283#endif
284#ifdef EPROTOTYPE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000285 inscode(d, ds, de, "EPROTOTYPE", EPROTOTYPE, "Protocol wrong type for socket");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000286#else
287#ifdef WSAEPROTOTYPE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000288 inscode(d, ds, de, "EPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000289#endif
290#endif
291#ifdef ENOSPC
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000292 inscode(d, ds, de, "ENOSPC", ENOSPC, "No space left on device");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000293#endif
294#ifdef ENOEXEC
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000295 inscode(d, ds, de, "ENOEXEC", ENOEXEC, "Exec format error");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000296#endif
297#ifdef EALREADY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000298 inscode(d, ds, de, "EALREADY", EALREADY, "Operation already in progress");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000299#else
300#ifdef WSAEALREADY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000301 inscode(d, ds, de, "EALREADY", WSAEALREADY, "Operation already in progress");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000302#endif
303#endif
304#ifdef ENETDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000305 inscode(d, ds, de, "ENETDOWN", ENETDOWN, "Network is down");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000306#else
307#ifdef WSAENETDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000308 inscode(d, ds, de, "ENETDOWN", WSAENETDOWN, "Network is down");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000309#endif
310#endif
311#ifdef ENOTNAM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000312 inscode(d, ds, de, "ENOTNAM", ENOTNAM, "Not a XENIX named type file");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000313#endif
314#ifdef EACCES
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000315 inscode(d, ds, de, "EACCES", EACCES, "Permission denied");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000316#else
317#ifdef WSAEACCES
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000318 inscode(d, ds, de, "EACCES", WSAEACCES, "Permission denied");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000319#endif
320#endif
321#ifdef ELNRNG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000322 inscode(d, ds, de, "ELNRNG", ELNRNG, "Link number out of range");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000323#endif
324#ifdef EILSEQ
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000325 inscode(d, ds, de, "EILSEQ", EILSEQ, "Illegal byte sequence");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000326#endif
327#ifdef ENOTDIR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000328 inscode(d, ds, de, "ENOTDIR", ENOTDIR, "Not a directory");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000329#endif
330#ifdef ENOTUNIQ
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000331 inscode(d, ds, de, "ENOTUNIQ", ENOTUNIQ, "Name not unique on network");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000332#endif
333#ifdef EPERM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000334 inscode(d, ds, de, "EPERM", EPERM, "Operation not permitted");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000335#endif
336#ifdef EDOM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000337 inscode(d, ds, de, "EDOM", EDOM, "Math argument out of domain of func");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000338#endif
339#ifdef EXFULL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000340 inscode(d, ds, de, "EXFULL", EXFULL, "Exchange full");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000341#endif
342#ifdef ECONNREFUSED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000343 inscode(d, ds, de, "ECONNREFUSED", ECONNREFUSED, "Connection refused");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000344#else
345#ifdef WSAECONNREFUSED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000346 inscode(d, ds, de, "ECONNREFUSED", WSAECONNREFUSED, "Connection refused");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000347#endif
348#endif
349#ifdef EISDIR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000350 inscode(d, ds, de, "EISDIR", EISDIR, "Is a directory");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000351#endif
352#ifdef EPROTONOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000353 inscode(d, ds, de, "EPROTONOSUPPORT", EPROTONOSUPPORT, "Protocol not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000354#else
355#ifdef WSAEPROTONOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000356 inscode(d, ds, de, "EPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000357#endif
358#endif
359#ifdef EROFS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000360 inscode(d, ds, de, "EROFS", EROFS, "Read-only file system");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000361#endif
362#ifdef EADDRNOTAVAIL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000363 inscode(d, ds, de, "EADDRNOTAVAIL", EADDRNOTAVAIL, "Cannot assign requested address");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000364#else
365#ifdef WSAEADDRNOTAVAIL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000366 inscode(d, ds, de, "EADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000367#endif
368#endif
369#ifdef EIDRM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000370 inscode(d, ds, de, "EIDRM", EIDRM, "Identifier removed");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000371#endif
372#ifdef ECOMM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000373 inscode(d, ds, de, "ECOMM", ECOMM, "Communication error on send");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000374#endif
375#ifdef ESRMNT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000376 inscode(d, ds, de, "ESRMNT", ESRMNT, "Srmount error");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000377#endif
378#ifdef EREMOTEIO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000379 inscode(d, ds, de, "EREMOTEIO", EREMOTEIO, "Remote I/O error");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000380#endif
381#ifdef EL3RST
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000382 inscode(d, ds, de, "EL3RST", EL3RST, "Level 3 reset");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000383#endif
384#ifdef EBADMSG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000385 inscode(d, ds, de, "EBADMSG", EBADMSG, "Not a data message");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000386#endif
387#ifdef ENFILE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000388 inscode(d, ds, de, "ENFILE", ENFILE, "File table overflow");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000389#endif
390#ifdef ELIBMAX
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000391 inscode(d, ds, de, "ELIBMAX", ELIBMAX, "Attempting to link in too many shared libraries");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000392#endif
393#ifdef ESPIPE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000394 inscode(d, ds, de, "ESPIPE", ESPIPE, "Illegal seek");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000395#endif
396#ifdef ENOLINK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000397 inscode(d, ds, de, "ENOLINK", ENOLINK, "Link has been severed");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000398#endif
399#ifdef ENETRESET
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000400 inscode(d, ds, de, "ENETRESET", ENETRESET, "Network dropped connection because of reset");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000401#else
402#ifdef WSAENETRESET
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000403 inscode(d, ds, de, "ENETRESET", WSAENETRESET, "Network dropped connection because of reset");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000404#endif
405#endif
406#ifdef ETIMEDOUT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000407 inscode(d, ds, de, "ETIMEDOUT", ETIMEDOUT, "Connection timed out");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000408#else
409#ifdef WSAETIMEDOUT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000410 inscode(d, ds, de, "ETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000411#endif
412#endif
413#ifdef ENOENT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000414 inscode(d, ds, de, "ENOENT", ENOENT, "No such file or directory");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000415#endif
416#ifdef EEXIST
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000417 inscode(d, ds, de, "EEXIST", EEXIST, "File exists");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000418#endif
419#ifdef EDQUOT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000420 inscode(d, ds, de, "EDQUOT", EDQUOT, "Quota exceeded");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000421#else
422#ifdef WSAEDQUOT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000423 inscode(d, ds, de, "EDQUOT", WSAEDQUOT, "Quota exceeded");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000424#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000425#endif
426#ifdef ENOSTR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000427 inscode(d, ds, de, "ENOSTR", ENOSTR, "Device not a stream");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000428#endif
429#ifdef EBADSLT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000430 inscode(d, ds, de, "EBADSLT", EBADSLT, "Invalid slot");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000431#endif
432#ifdef EBADRQC
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000433 inscode(d, ds, de, "EBADRQC", EBADRQC, "Invalid request code");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000434#endif
435#ifdef ELIBACC
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000436 inscode(d, ds, de, "ELIBACC", ELIBACC, "Can not access a needed shared library");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000437#endif
438#ifdef EFAULT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000439 inscode(d, ds, de, "EFAULT", EFAULT, "Bad address");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000440#else
441#ifdef WSAEFAULT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000442 inscode(d, ds, de, "EFAULT", WSAEFAULT, "Bad address");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000443#endif
444#endif
445#ifdef EFBIG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000446 inscode(d, ds, de, "EFBIG", EFBIG, "File too large");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000447#endif
448#ifdef EDEADLK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000449 inscode(d, ds, de, "EDEADLK", EDEADLK, "Resource deadlock would occur");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000450#endif
451#ifdef ENOTCONN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000452 inscode(d, ds, de, "ENOTCONN", ENOTCONN, "Transport endpoint is not connected");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000453#else
454#ifdef WSAENOTCONN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000455 inscode(d, ds, de, "ENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000456#endif
457#endif
458#ifdef EDESTADDRREQ
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000459 inscode(d, ds, de, "EDESTADDRREQ", EDESTADDRREQ, "Destination address required");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000460#else
461#ifdef WSAEDESTADDRREQ
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000462 inscode(d, ds, de, "EDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000463#endif
464#endif
465#ifdef ELIBSCN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000466 inscode(d, ds, de, "ELIBSCN", ELIBSCN, ".lib section in a.out corrupted");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000467#endif
468#ifdef ENOLCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000469 inscode(d, ds, de, "ENOLCK", ENOLCK, "No record locks available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000470#endif
471#ifdef EISNAM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000472 inscode(d, ds, de, "EISNAM", EISNAM, "Is a named type file");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000473#endif
474#ifdef ECONNABORTED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000475 inscode(d, ds, de, "ECONNABORTED", ECONNABORTED, "Software caused connection abort");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000476#else
477#ifdef WSAECONNABORTED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000478 inscode(d, ds, de, "ECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000479#endif
480#endif
481#ifdef ENETUNREACH
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000482 inscode(d, ds, de, "ENETUNREACH", ENETUNREACH, "Network is unreachable");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000483#else
484#ifdef WSAENETUNREACH
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000485 inscode(d, ds, de, "ENETUNREACH", WSAENETUNREACH, "Network is unreachable");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000486#endif
487#endif
488#ifdef ESTALE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000489 inscode(d, ds, de, "ESTALE", ESTALE, "Stale NFS file handle");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000490#else
491#ifdef WSAESTALE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000492 inscode(d, ds, de, "ESTALE", WSAESTALE, "Stale NFS file handle");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000493#endif
494#endif
495#ifdef ENOSR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000496 inscode(d, ds, de, "ENOSR", ENOSR, "Out of streams resources");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000497#endif
498#ifdef ENOMEM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000499 inscode(d, ds, de, "ENOMEM", ENOMEM, "Out of memory");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000500#endif
501#ifdef ENOTSOCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000502 inscode(d, ds, de, "ENOTSOCK", ENOTSOCK, "Socket operation on non-socket");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000503#else
504#ifdef WSAENOTSOCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000505 inscode(d, ds, de, "ENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000506#endif
507#endif
508#ifdef ESTRPIPE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000509 inscode(d, ds, de, "ESTRPIPE", ESTRPIPE, "Streams pipe error");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000510#endif
511#ifdef EMLINK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000512 inscode(d, ds, de, "EMLINK", EMLINK, "Too many links");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000513#endif
514#ifdef ERANGE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000515 inscode(d, ds, de, "ERANGE", ERANGE, "Math result not representable");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000516#endif
517#ifdef ELIBEXEC
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000518 inscode(d, ds, de, "ELIBEXEC", ELIBEXEC, "Cannot exec a shared library directly");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000519#endif
520#ifdef EL3HLT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000521 inscode(d, ds, de, "EL3HLT", EL3HLT, "Level 3 halted");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000522#endif
523#ifdef ECONNRESET
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000524 inscode(d, ds, de, "ECONNRESET", ECONNRESET, "Connection reset by peer");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000525#else
526#ifdef WSAECONNRESET
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000527 inscode(d, ds, de, "ECONNRESET", WSAECONNRESET, "Connection reset by peer");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000528#endif
529#endif
530#ifdef EADDRINUSE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000531 inscode(d, ds, de, "EADDRINUSE", EADDRINUSE, "Address already in use");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000532#else
533#ifdef WSAEADDRINUSE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000534 inscode(d, ds, de, "EADDRINUSE", WSAEADDRINUSE, "Address already in use");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000535#endif
536#endif
537#ifdef EOPNOTSUPP
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000538 inscode(d, ds, de, "EOPNOTSUPP", EOPNOTSUPP, "Operation not supported on transport endpoint");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000539#else
540#ifdef WSAEOPNOTSUPP
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000541 inscode(d, ds, de, "EOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000542#endif
543#endif
544#ifdef EREMCHG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000545 inscode(d, ds, de, "EREMCHG", EREMCHG, "Remote address changed");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000546#endif
547#ifdef EAGAIN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000548 inscode(d, ds, de, "EAGAIN", EAGAIN, "Try again");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000549#endif
550#ifdef ENAMETOOLONG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000551 inscode(d, ds, de, "ENAMETOOLONG", ENAMETOOLONG, "File name too long");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000552#else
553#ifdef WSAENAMETOOLONG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000554 inscode(d, ds, de, "ENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000555#endif
556#endif
557#ifdef ENOTTY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000558 inscode(d, ds, de, "ENOTTY", ENOTTY, "Not a typewriter");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000559#endif
560#ifdef ERESTART
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000561 inscode(d, ds, de, "ERESTART", ERESTART, "Interrupted system call should be restarted");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000562#endif
563#ifdef ESOCKTNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000564 inscode(d, ds, de, "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, "Socket type not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000565#else
566#ifdef WSAESOCKTNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000567 inscode(d, ds, de, "ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000568#endif
569#endif
570#ifdef ETIME
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000571 inscode(d, ds, de, "ETIME", ETIME, "Timer expired");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000572#endif
573#ifdef EBFONT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000574 inscode(d, ds, de, "EBFONT", EBFONT, "Bad font file format");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000575#endif
576#ifdef EDEADLOCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000577 inscode(d, ds, de, "EDEADLOCK", EDEADLOCK, "Error EDEADLOCK");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000578#endif
579#ifdef ETOOMANYREFS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000580 inscode(d, ds, de, "ETOOMANYREFS", ETOOMANYREFS, "Too many references: cannot splice");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000581#else
582#ifdef WSAETOOMANYREFS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000583 inscode(d, ds, de, "ETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000584#endif
585#endif
586#ifdef EMFILE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000587 inscode(d, ds, de, "EMFILE", EMFILE, "Too many open files");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000588#else
589#ifdef WSAEMFILE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000590 inscode(d, ds, de, "EMFILE", WSAEMFILE, "Too many open files");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000591#endif
592#endif
593#ifdef ETXTBSY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000594 inscode(d, ds, de, "ETXTBSY", ETXTBSY, "Text file busy");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000595#endif
596#ifdef EINPROGRESS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000597 inscode(d, ds, de, "EINPROGRESS", EINPROGRESS, "Operation now in progress");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000598#else
599#ifdef WSAEINPROGRESS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000600 inscode(d, ds, de, "EINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000601#endif
602#endif
603#ifdef ENXIO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000604 inscode(d, ds, de, "ENXIO", ENXIO, "No such device or address");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000605#endif
606#ifdef ENOPKG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000607 inscode(d, ds, de, "ENOPKG", ENOPKG, "Package not installed");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000608#endif
609#ifdef WSASY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000610 inscode(d, ds, de, "WSASY", WSASY, "Error WSASY");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000611#endif
612#ifdef WSAEHOSTDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000613 inscode(d, ds, de, "WSAEHOSTDOWN", WSAEHOSTDOWN, "Host is down");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000614#endif
615#ifdef WSAENETDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000616 inscode(d, ds, de, "WSAENETDOWN", WSAENETDOWN, "Network is down");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000617#endif
618#ifdef WSAENOTSOCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000619 inscode(d, ds, de, "WSAENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000620#endif
621#ifdef WSAEHOSTUNREACH
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000622 inscode(d, ds, de, "WSAEHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000623#endif
624#ifdef WSAELOOP
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000625 inscode(d, ds, de, "WSAELOOP", WSAELOOP, "Too many symbolic links encountered");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000626#endif
627#ifdef WSAEMFILE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000628 inscode(d, ds, de, "WSAEMFILE", WSAEMFILE, "Too many open files");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000629#endif
630#ifdef WSAESTALE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000631 inscode(d, ds, de, "WSAESTALE", WSAESTALE, "Stale NFS file handle");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000632#endif
633#ifdef WSAVERNOTSUPPORTED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000634 inscode(d, ds, de, "WSAVERNOTSUPPORTED", WSAVERNOTSUPPORTED, "Error WSAVERNOTSUPPORTED");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000635#endif
636#ifdef WSAENETUNREACH
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000637 inscode(d, ds, de, "WSAENETUNREACH", WSAENETUNREACH, "Network is unreachable");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000638#endif
639#ifdef WSAEPROCLIM
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000640 inscode(d, ds, de, "WSAEPROCLIM", WSAEPROCLIM, "Error WSAEPROCLIM");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000641#endif
642#ifdef WSAEFAULT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000643 inscode(d, ds, de, "WSAEFAULT", WSAEFAULT, "Bad address");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000644#endif
645#ifdef WSANOTINITIALISED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000646 inscode(d, ds, de, "WSANOTINITIALISED", WSANOTINITIALISED, "Error WSANOTINITIALISED");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000647#endif
648#ifdef WSAEUSERS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000649 inscode(d, ds, de, "WSAEUSERS", WSAEUSERS, "Too many users");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000650#endif
651#ifdef WSAMAKEASYNCREPL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000652 inscode(d, ds, de, "WSAMAKEASYNCREPL", WSAMAKEASYNCREPL, "Error WSAMAKEASYNCREPL");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000653#endif
654#ifdef WSAENOPROTOOPT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000655 inscode(d, ds, de, "WSAENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000656#endif
657#ifdef WSAECONNABORTED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000658 inscode(d, ds, de, "WSAECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000659#endif
660#ifdef WSAENAMETOOLONG
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000661 inscode(d, ds, de, "WSAENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000662#endif
663#ifdef WSAENOTEMPTY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000664 inscode(d, ds, de, "WSAENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000665#endif
666#ifdef WSAESHUTDOWN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000667 inscode(d, ds, de, "WSAESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000668#endif
669#ifdef WSAEAFNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000670 inscode(d, ds, de, "WSAEAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000671#endif
672#ifdef WSAETOOMANYREFS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000673 inscode(d, ds, de, "WSAETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000674#endif
675#ifdef WSAEACCES
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000676 inscode(d, ds, de, "WSAEACCES", WSAEACCES, "Permission denied");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000677#endif
678#ifdef WSATR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000679 inscode(d, ds, de, "WSATR", WSATR, "Error WSATR");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000680#endif
681#ifdef WSABASEERR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000682 inscode(d, ds, de, "WSABASEERR", WSABASEERR, "Error WSABASEERR");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000683#endif
684#ifdef WSADESCRIPTIO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000685 inscode(d, ds, de, "WSADESCRIPTIO", WSADESCRIPTIO, "Error WSADESCRIPTIO");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000686#endif
687#ifdef WSAEMSGSIZE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000688 inscode(d, ds, de, "WSAEMSGSIZE", WSAEMSGSIZE, "Message too long");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000689#endif
690#ifdef WSAEBADF
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000691 inscode(d, ds, de, "WSAEBADF", WSAEBADF, "Bad file number");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000692#endif
693#ifdef WSAECONNRESET
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000694 inscode(d, ds, de, "WSAECONNRESET", WSAECONNRESET, "Connection reset by peer");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000695#endif
696#ifdef WSAGETSELECTERRO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000697 inscode(d, ds, de, "WSAGETSELECTERRO", WSAGETSELECTERRO, "Error WSAGETSELECTERRO");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000698#endif
699#ifdef WSAETIMEDOUT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000700 inscode(d, ds, de, "WSAETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000701#endif
702#ifdef WSAENOBUFS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000703 inscode(d, ds, de, "WSAENOBUFS", WSAENOBUFS, "No buffer space available");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000704#endif
705#ifdef WSAEDISCON
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000706 inscode(d, ds, de, "WSAEDISCON", WSAEDISCON, "Error WSAEDISCON");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000707#endif
708#ifdef WSAEINTR
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000709 inscode(d, ds, de, "WSAEINTR", WSAEINTR, "Interrupted system call");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000710#endif
711#ifdef WSAEPROTOTYPE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000712 inscode(d, ds, de, "WSAEPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000713#endif
714#ifdef WSAHOS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000715 inscode(d, ds, de, "WSAHOS", WSAHOS, "Error WSAHOS");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000716#endif
717#ifdef WSAEADDRINUSE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000718 inscode(d, ds, de, "WSAEADDRINUSE", WSAEADDRINUSE, "Address already in use");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000719#endif
720#ifdef WSAEADDRNOTAVAIL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000721 inscode(d, ds, de, "WSAEADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000722#endif
723#ifdef WSAEALREADY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000724 inscode(d, ds, de, "WSAEALREADY", WSAEALREADY, "Operation already in progress");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000725#endif
726#ifdef WSAEPROTONOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000727 inscode(d, ds, de, "WSAEPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000728#endif
729#ifdef WSASYSNOTREADY
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000730 inscode(d, ds, de, "WSASYSNOTREADY", WSASYSNOTREADY, "Error WSASYSNOTREADY");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000731#endif
732#ifdef WSAEWOULDBLOCK
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000733 inscode(d, ds, de, "WSAEWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000734#endif
735#ifdef WSAEPFNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000736 inscode(d, ds, de, "WSAEPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000737#endif
738#ifdef WSAEOPNOTSUPP
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000739 inscode(d, ds, de, "WSAEOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000740#endif
741#ifdef WSAEISCONN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000742 inscode(d, ds, de, "WSAEISCONN", WSAEISCONN, "Transport endpoint is already connected");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000743#endif
744#ifdef WSAEDQUOT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000745 inscode(d, ds, de, "WSAEDQUOT", WSAEDQUOT, "Quota exceeded");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000746#endif
747#ifdef WSAENOTCONN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000748 inscode(d, ds, de, "WSAENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000749#endif
750#ifdef WSAEREMOTE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000751 inscode(d, ds, de, "WSAEREMOTE", WSAEREMOTE, "Object is remote");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000752#endif
753#ifdef WSAEINVAL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000754 inscode(d, ds, de, "WSAEINVAL", WSAEINVAL, "Invalid argument");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000755#endif
756#ifdef WSAEINPROGRESS
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000757 inscode(d, ds, de, "WSAEINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000758#endif
759#ifdef WSAGETSELECTEVEN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000760 inscode(d, ds, de, "WSAGETSELECTEVEN", WSAGETSELECTEVEN, "Error WSAGETSELECTEVEN");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000761#endif
762#ifdef WSAESOCKTNOSUPPORT
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000763 inscode(d, ds, de, "WSAESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000764#endif
765#ifdef WSAGETASYNCERRO
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000766 inscode(d, ds, de, "WSAGETASYNCERRO", WSAGETASYNCERRO, "Error WSAGETASYNCERRO");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000767#endif
768#ifdef WSAMAKESELECTREPL
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000769 inscode(d, ds, de, "WSAMAKESELECTREPL", WSAMAKESELECTREPL, "Error WSAMAKESELECTREPL");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000770#endif
771#ifdef WSAGETASYNCBUFLE
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000772 inscode(d, ds, de, "WSAGETASYNCBUFLE", WSAGETASYNCBUFLE, "Error WSAGETASYNCBUFLE");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000773#endif
774#ifdef WSAEDESTADDRREQ
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000775 inscode(d, ds, de, "WSAEDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000776#endif
777#ifdef WSAECONNREFUSED
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000778 inscode(d, ds, de, "WSAECONNREFUSED", WSAECONNREFUSED, "Connection refused");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000779#endif
780#ifdef WSAENETRESET
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000781 inscode(d, ds, de, "WSAENETRESET", WSAENETRESET, "Network dropped connection because of reset");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000782#endif
783#ifdef WSAN
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000784 inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000785#endif
786
Antoine Pitrouc83ea132010-05-09 14:46:46 +0000787 Py_DECREF(de);
Guido van Rossum4dc66221996-07-24 00:51:51 +0000788}