Python-2.7.3/Modules/errnomodule.c

No issues found

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