blob: be36ca64e4dc804df05d03990e7981893fe5a25e [file] [log] [blame]
Guido van Rossum4dc66221996-07-24 00:51:51 +00001/***********************************************************
2Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
4
5 All Rights Reserved
6
Guido van Rossumd266eb41996-10-25 14:44:06 +00007Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
Guido van Rossum4dc66221996-07-24 00:51:51 +00009provided that the above copyright notice appear in all copies and that
Guido van Rossumd266eb41996-10-25 14:44:06 +000010both that copyright notice and this permission notice appear in
Guido van Rossum4dc66221996-07-24 00:51:51 +000011supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumd266eb41996-10-25 14:44:06 +000012Centrum or CWI or Corporation for National Research Initiatives or
13CNRI not be used in advertising or publicity pertaining to
14distribution of the software without specific, written prior
15permission.
Guido van Rossum4dc66221996-07-24 00:51:51 +000016
Guido van Rossumd266eb41996-10-25 14:44:06 +000017While CWI is the initial source for this software, a modified version
18is made available by the Corporation for National Research Initiatives
19(CNRI) at the Internet address ftp://ftp.python.org.
20
21STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum4dc66221996-07-24 00:51:51 +000029
30******************************************************************/
31
32/* Errno module */
33
34#include "Python.h"
35
Guido van Rossumfb421c81997-04-11 19:11:25 +000036/* Mac with GUSI has more errors than those in errno.h */
37#ifdef USE_GUSI
38#include <sys/errno.h>
39#endif
40
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000041/* Windows socket errors (WSA*): XXX is this the correct path ??? */
42#ifdef MS_WINDOWS
43#include <winsock.h>
44#endif
45
Guido van Rossum4dc66221996-07-24 00:51:51 +000046/*
47 * Pull in the system error definitions
48 */
49
Guido van Rossum4dc66221996-07-24 00:51:51 +000050static PyMethodDef errno_methods[] = {
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000051 {NULL, NULL}
Guido van Rossum4dc66221996-07-24 00:51:51 +000052};
53
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000054/* Helper function doing the dictionary inserting */
Guido van Rossum4dc66221996-07-24 00:51:51 +000055
56static void
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000057inscode(d, e, c, name, code, comment)
Guido van Rossum4dc66221996-07-24 00:51:51 +000058 PyObject * d;
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000059 PyObject * e;
60 PyObject * c;
61 char *name;
62 int code;
63 char * comment;
Guido van Rossum4dc66221996-07-24 00:51:51 +000064{
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000065 PyObject *u;
66 PyObject *v;
67 PyObject *w;
68
69#ifdef HAVE_STRERROR
70 if (strerror(code) != NULL)
71 comment = strerror(code);
72#endif
73
74 u = PyString_FromString(name);
75 v = PyInt_FromLong((long) code);
76 w = PyString_FromString(comment);
77
78 if (!u || !v || !w) {
Guido van Rossum4dc66221996-07-24 00:51:51 +000079 /* Don't bother reporting this error */
80 PyErr_Clear();
81 }
82 else {
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000083 /* insert in modules dict */
84 PyDict_SetItem(d, u, v);
85 /* insert in errorstr dict */
86 PyDict_SetItem(e, v, w);
87 /* insert in errorcode dict */
88 PyDict_SetItem(c, v, u);
Guido van Rossum4dc66221996-07-24 00:51:51 +000089 }
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000090 Py_XDECREF(u);
91 Py_XDECREF(v);
92 Py_XDECREF(w);
Guido van Rossum4dc66221996-07-24 00:51:51 +000093}
94
95void
96initerrno()
97{
Guido van Rossum49f9d8e1997-09-28 05:41:56 +000098 PyObject *m, *d, *ds, *de;
Guido van Rossum4dc66221996-07-24 00:51:51 +000099 m = Py_InitModule("errno", errno_methods);
100 d = PyModule_GetDict(m);
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000101 ds = PyDict_New();
102 if (ds == NULL || PyDict_SetItemString(d,"errorstr",ds))
103 Py_FatalError("can't initialize errno module");
104 de = PyDict_New();
105 if (de == NULL || PyDict_SetItemString(d,"errorcode",de))
106 Py_FatalError("can't initialize errno module");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000107
108 /*
109 * The names and comments are borrowed from linux/include/errno.h,
110 * which should be pretty all-inclusive
111 */
112
Guido van Rossum4dc66221996-07-24 00:51:51 +0000113#ifdef ENODEV
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000114 inscode(d, ds, de, "ENODEV", ENODEV, "No such device");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000115#endif
116#ifdef ENOCSI
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000117 inscode(d, ds, de, "ENOCSI", ENOCSI, "No CSI structure available");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000118#endif
119#ifdef EHOSTUNREACH
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000120 inscode(d, ds, de, "EHOSTUNREACH", EHOSTUNREACH, "No route to host");
121#else
122#ifdef WSAEHOSTUNREACH
123 inscode(d, ds, de, "EHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000124#endif
Guido van Rossum4dc66221996-07-24 00:51:51 +0000125#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000126#ifdef ENOMSG
127 inscode(d, ds, de, "ENOMSG", ENOMSG, "No message of desired type");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000128#endif
129#ifdef EUCLEAN
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000130 inscode(d, ds, de, "EUCLEAN", EUCLEAN, "Structure needs cleaning");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000131#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000132#ifdef EL2NSYNC
133 inscode(d, ds, de, "EL2NSYNC", EL2NSYNC, "Level 2 not synchronized");
134#endif
135#ifdef EL2HLT
136 inscode(d, ds, de, "EL2HLT", EL2HLT, "Level 2 halted");
137#endif
138#ifdef ENODATA
139 inscode(d, ds, de, "ENODATA", ENODATA, "No data available");
140#endif
141#ifdef ENOTBLK
142 inscode(d, ds, de, "ENOTBLK", ENOTBLK, "Block device required");
143#endif
144#ifdef ENOSYS
145 inscode(d, ds, de, "ENOSYS", ENOSYS, "Function not implemented");
146#endif
147#ifdef EPIPE
148 inscode(d, ds, de, "EPIPE", EPIPE, "Broken pipe");
149#endif
150#ifdef EINVAL
151 inscode(d, ds, de, "EINVAL", EINVAL, "Invalid argument");
152#else
153#ifdef WSAEINVAL
154 inscode(d, ds, de, "EINVAL", WSAEINVAL, "Invalid argument");
155#endif
156#endif
157#ifdef EOVERFLOW
158 inscode(d, ds, de, "EOVERFLOW", EOVERFLOW, "Value too large for defined data type");
159#endif
160#ifdef EADV
161 inscode(d, ds, de, "EADV", EADV, "Advertise error");
162#endif
163#ifdef EINTR
164 inscode(d, ds, de, "EINTR", EINTR, "Interrupted system call");
165#else
166#ifdef WSAEINTR
167 inscode(d, ds, de, "EINTR", WSAEINTR, "Interrupted system call");
168#endif
169#endif
170#ifdef EUSERS
171 inscode(d, ds, de, "EUSERS", EUSERS, "Too many users");
172#else
173#ifdef WSAEUSERS
174 inscode(d, ds, de, "EUSERS", WSAEUSERS, "Too many users");
175#endif
176#endif
177#ifdef ENOTEMPTY
178 inscode(d, ds, de, "ENOTEMPTY", ENOTEMPTY, "Directory not empty");
179#else
180#ifdef WSAENOTEMPTY
181 inscode(d, ds, de, "ENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
182#endif
183#endif
184#ifdef ENOBUFS
185 inscode(d, ds, de, "ENOBUFS", ENOBUFS, "No buffer space available");
186#else
187#ifdef WSAENOBUFS
188 inscode(d, ds, de, "ENOBUFS", WSAENOBUFS, "No buffer space available");
189#endif
190#endif
191#ifdef EPROTO
192 inscode(d, ds, de, "EPROTO", EPROTO, "Protocol error");
193#endif
194#ifdef EREMOTE
195 inscode(d, ds, de, "EREMOTE", EREMOTE, "Object is remote");
196#else
197#ifdef WSAEREMOTE
198 inscode(d, ds, de, "EREMOTE", WSAEREMOTE, "Object is remote");
199#endif
Guido van Rossum4dc66221996-07-24 00:51:51 +0000200#endif
201#ifdef ENAVAIL
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000202 inscode(d, ds, de, "ENAVAIL", ENAVAIL, "No XENIX semaphores available");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000203#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000204#ifdef ECHILD
205 inscode(d, ds, de, "ECHILD", ECHILD, "No child processes");
206#endif
207#ifdef ELOOP
208 inscode(d, ds, de, "ELOOP", ELOOP, "Too many symbolic links encountered");
209#else
210#ifdef WSAELOOP
211 inscode(d, ds, de, "ELOOP", WSAELOOP, "Too many symbolic links encountered");
212#endif
213#endif
214#ifdef EXDEV
215 inscode(d, ds, de, "EXDEV", EXDEV, "Cross-device link");
216#endif
217#ifdef E2BIG
218 inscode(d, ds, de, "E2BIG", E2BIG, "Arg list too long");
219#endif
220#ifdef ESRCH
221 inscode(d, ds, de, "ESRCH", ESRCH, "No such process");
222#endif
223#ifdef EMSGSIZE
224 inscode(d, ds, de, "EMSGSIZE", EMSGSIZE, "Message too long");
225#else
226#ifdef WSAEMSGSIZE
227 inscode(d, ds, de, "EMSGSIZE", WSAEMSGSIZE, "Message too long");
228#endif
229#endif
230#ifdef EAFNOSUPPORT
231 inscode(d, ds, de, "EAFNOSUPPORT", EAFNOSUPPORT, "Address family not supported by protocol");
232#else
233#ifdef WSAEAFNOSUPPORT
234 inscode(d, ds, de, "EAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
235#endif
236#endif
237#ifdef EBADR
238 inscode(d, ds, de, "EBADR", EBADR, "Invalid request descriptor");
239#endif
240#ifdef EHOSTDOWN
241 inscode(d, ds, de, "EHOSTDOWN", EHOSTDOWN, "Host is down");
242#else
243#ifdef WSAEHOSTDOWN
244 inscode(d, ds, de, "EHOSTDOWN", WSAEHOSTDOWN, "Host is down");
245#endif
246#endif
247#ifdef EPFNOSUPPORT
248 inscode(d, ds, de, "EPFNOSUPPORT", EPFNOSUPPORT, "Protocol family not supported");
249#else
250#ifdef WSAEPFNOSUPPORT
251 inscode(d, ds, de, "EPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
252#endif
253#endif
254#ifdef ENOPROTOOPT
255 inscode(d, ds, de, "ENOPROTOOPT", ENOPROTOOPT, "Protocol not available");
256#else
257#ifdef WSAENOPROTOOPT
258 inscode(d, ds, de, "ENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
259#endif
260#endif
261#ifdef EBUSY
262 inscode(d, ds, de, "EBUSY", EBUSY, "Device or resource busy");
263#endif
264#ifdef EWOULDBLOCK
265 inscode(d, ds, de, "EWOULDBLOCK", EWOULDBLOCK, "Operation would block");
266#else
267#ifdef WSAEWOULDBLOCK
268 inscode(d, ds, de, "EWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
269#endif
270#endif
271#ifdef EBADFD
272 inscode(d, ds, de, "EBADFD", EBADFD, "File descriptor in bad state");
273#endif
274#ifdef EDOTDOT
275 inscode(d, ds, de, "EDOTDOT", EDOTDOT, "RFS specific error");
276#endif
277#ifdef EISCONN
278 inscode(d, ds, de, "EISCONN", EISCONN, "Transport endpoint is already connected");
279#else
280#ifdef WSAEISCONN
281 inscode(d, ds, de, "EISCONN", WSAEISCONN, "Transport endpoint is already connected");
282#endif
283#endif
284#ifdef ENOANO
285 inscode(d, ds, de, "ENOANO", ENOANO, "No anode");
286#endif
287#ifdef ESHUTDOWN
288 inscode(d, ds, de, "ESHUTDOWN", ESHUTDOWN, "Cannot send after transport endpoint shutdown");
289#else
290#ifdef WSAESHUTDOWN
291 inscode(d, ds, de, "ESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
292#endif
293#endif
294#ifdef ECHRNG
295 inscode(d, ds, de, "ECHRNG", ECHRNG, "Channel number out of range");
296#endif
297#ifdef ELIBBAD
298 inscode(d, ds, de, "ELIBBAD", ELIBBAD, "Accessing a corrupted shared library");
299#endif
300#ifdef ENONET
301 inscode(d, ds, de, "ENONET", ENONET, "Machine is not on the network");
302#endif
303#ifdef EBADE
304 inscode(d, ds, de, "EBADE", EBADE, "Invalid exchange");
305#endif
306#ifdef EBADF
307 inscode(d, ds, de, "EBADF", EBADF, "Bad file number");
308#else
309#ifdef WSAEBADF
310 inscode(d, ds, de, "EBADF", WSAEBADF, "Bad file number");
311#endif
312#endif
313#ifdef EMULTIHOP
314 inscode(d, ds, de, "EMULTIHOP", EMULTIHOP, "Multihop attempted");
315#endif
316#ifdef EIO
317 inscode(d, ds, de, "EIO", EIO, "I/O error");
318#endif
319#ifdef EUNATCH
320 inscode(d, ds, de, "EUNATCH", EUNATCH, "Protocol driver not attached");
321#endif
322#ifdef EPROTOTYPE
323 inscode(d, ds, de, "EPROTOTYPE", EPROTOTYPE, "Protocol wrong type for socket");
324#else
325#ifdef WSAEPROTOTYPE
326 inscode(d, ds, de, "EPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
327#endif
328#endif
329#ifdef ENOSPC
330 inscode(d, ds, de, "ENOSPC", ENOSPC, "No space left on device");
331#endif
332#ifdef ENOEXEC
333 inscode(d, ds, de, "ENOEXEC", ENOEXEC, "Exec format error");
334#endif
335#ifdef EALREADY
336 inscode(d, ds, de, "EALREADY", EALREADY, "Operation already in progress");
337#else
338#ifdef WSAEALREADY
339 inscode(d, ds, de, "EALREADY", WSAEALREADY, "Operation already in progress");
340#endif
341#endif
342#ifdef ENETDOWN
343 inscode(d, ds, de, "ENETDOWN", ENETDOWN, "Network is down");
344#else
345#ifdef WSAENETDOWN
346 inscode(d, ds, de, "ENETDOWN", WSAENETDOWN, "Network is down");
347#endif
348#endif
349#ifdef ENOTNAM
350 inscode(d, ds, de, "ENOTNAM", ENOTNAM, "Not a XENIX named type file");
351#endif
352#ifdef EACCES
353 inscode(d, ds, de, "EACCES", EACCES, "Permission denied");
354#else
355#ifdef WSAEACCES
356 inscode(d, ds, de, "EACCES", WSAEACCES, "Permission denied");
357#endif
358#endif
359#ifdef ELNRNG
360 inscode(d, ds, de, "ELNRNG", ELNRNG, "Link number out of range");
361#endif
362#ifdef EILSEQ
363 inscode(d, ds, de, "EILSEQ", EILSEQ, "Illegal byte sequence");
364#endif
365#ifdef ENOTDIR
366 inscode(d, ds, de, "ENOTDIR", ENOTDIR, "Not a directory");
367#endif
368#ifdef ENOTUNIQ
369 inscode(d, ds, de, "ENOTUNIQ", ENOTUNIQ, "Name not unique on network");
370#endif
371#ifdef EPERM
372 inscode(d, ds, de, "EPERM", EPERM, "Operation not permitted");
373#endif
374#ifdef EDOM
375 inscode(d, ds, de, "EDOM", EDOM, "Math argument out of domain of func");
376#endif
377#ifdef EXFULL
378 inscode(d, ds, de, "EXFULL", EXFULL, "Exchange full");
379#endif
380#ifdef ECONNREFUSED
381 inscode(d, ds, de, "ECONNREFUSED", ECONNREFUSED, "Connection refused");
382#else
383#ifdef WSAECONNREFUSED
384 inscode(d, ds, de, "ECONNREFUSED", WSAECONNREFUSED, "Connection refused");
385#endif
386#endif
387#ifdef EISDIR
388 inscode(d, ds, de, "EISDIR", EISDIR, "Is a directory");
389#endif
390#ifdef EPROTONOSUPPORT
391 inscode(d, ds, de, "EPROTONOSUPPORT", EPROTONOSUPPORT, "Protocol not supported");
392#else
393#ifdef WSAEPROTONOSUPPORT
394 inscode(d, ds, de, "EPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
395#endif
396#endif
397#ifdef EROFS
398 inscode(d, ds, de, "EROFS", EROFS, "Read-only file system");
399#endif
400#ifdef EADDRNOTAVAIL
401 inscode(d, ds, de, "EADDRNOTAVAIL", EADDRNOTAVAIL, "Cannot assign requested address");
402#else
403#ifdef WSAEADDRNOTAVAIL
404 inscode(d, ds, de, "EADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
405#endif
406#endif
407#ifdef EIDRM
408 inscode(d, ds, de, "EIDRM", EIDRM, "Identifier removed");
409#endif
410#ifdef ECOMM
411 inscode(d, ds, de, "ECOMM", ECOMM, "Communication error on send");
412#endif
413#ifdef ESRMNT
414 inscode(d, ds, de, "ESRMNT", ESRMNT, "Srmount error");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000415#endif
416#ifdef EREMOTEIO
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000417 inscode(d, ds, de, "EREMOTEIO", EREMOTEIO, "Remote I/O error");
418#endif
419#ifdef EL3RST
420 inscode(d, ds, de, "EL3RST", EL3RST, "Level 3 reset");
421#endif
422#ifdef EBADMSG
423 inscode(d, ds, de, "EBADMSG", EBADMSG, "Not a data message");
424#endif
425#ifdef ENFILE
426 inscode(d, ds, de, "ENFILE", ENFILE, "File table overflow");
427#endif
428#ifdef ELIBMAX
429 inscode(d, ds, de, "ELIBMAX", ELIBMAX, "Attempting to link in too many shared libraries");
430#endif
431#ifdef ESPIPE
432 inscode(d, ds, de, "ESPIPE", ESPIPE, "Illegal seek");
433#endif
434#ifdef ENOLINK
435 inscode(d, ds, de, "ENOLINK", ENOLINK, "Link has been severed");
436#endif
437#ifdef ENETRESET
438 inscode(d, ds, de, "ENETRESET", ENETRESET, "Network dropped connection because of reset");
439#else
440#ifdef WSAENETRESET
441 inscode(d, ds, de, "ENETRESET", WSAENETRESET, "Network dropped connection because of reset");
442#endif
443#endif
444#ifdef ETIMEDOUT
445 inscode(d, ds, de, "ETIMEDOUT", ETIMEDOUT, "Connection timed out");
446#else
447#ifdef WSAETIMEDOUT
448 inscode(d, ds, de, "ETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
449#endif
450#endif
451#ifdef ENOENT
452 inscode(d, ds, de, "ENOENT", ENOENT, "No such file or directory");
453#endif
454#ifdef EEXIST
455 inscode(d, ds, de, "EEXIST", EEXIST, "File exists");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000456#endif
457#ifdef EDQUOT
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000458 inscode(d, ds, de, "EDQUOT", EDQUOT, "Quota exceeded");
459#else
460#ifdef WSAEDQUOT
461 inscode(d, ds, de, "EDQUOT", WSAEDQUOT, "Quota exceeded");
Guido van Rossum4dc66221996-07-24 00:51:51 +0000462#endif
Guido van Rossum49f9d8e1997-09-28 05:41:56 +0000463#endif
464#ifdef ENOSTR
465 inscode(d, ds, de, "ENOSTR", ENOSTR, "Device not a stream");
466#endif
467#ifdef EBADSLT
468 inscode(d, ds, de, "EBADSLT", EBADSLT, "Invalid slot");
469#endif
470#ifdef EBADRQC
471 inscode(d, ds, de, "EBADRQC", EBADRQC, "Invalid request code");
472#endif
473#ifdef ELIBACC
474 inscode(d, ds, de, "ELIBACC", ELIBACC, "Can not access a needed shared library");
475#endif
476#ifdef EFAULT
477 inscode(d, ds, de, "EFAULT", EFAULT, "Bad address");
478#else
479#ifdef WSAEFAULT
480 inscode(d, ds, de, "EFAULT", WSAEFAULT, "Bad address");
481#endif
482#endif
483#ifdef EFBIG
484 inscode(d, ds, de, "EFBIG", EFBIG, "File too large");
485#endif
486#ifdef EDEADLK
487 inscode(d, ds, de, "EDEADLK", EDEADLK, "Resource deadlock would occur");
488#endif
489#ifdef ENOTCONN
490 inscode(d, ds, de, "ENOTCONN", ENOTCONN, "Transport endpoint is not connected");
491#else
492#ifdef WSAENOTCONN
493 inscode(d, ds, de, "ENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
494#endif
495#endif
496#ifdef EDESTADDRREQ
497 inscode(d, ds, de, "EDESTADDRREQ", EDESTADDRREQ, "Destination address required");
498#else
499#ifdef WSAEDESTADDRREQ
500 inscode(d, ds, de, "EDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
501#endif
502#endif
503#ifdef ELIBSCN
504 inscode(d, ds, de, "ELIBSCN", ELIBSCN, ".lib section in a.out corrupted");
505#endif
506#ifdef ENOLCK
507 inscode(d, ds, de, "ENOLCK", ENOLCK, "No record locks available");
508#endif
509#ifdef EISNAM
510 inscode(d, ds, de, "EISNAM", EISNAM, "Is a named type file");
511#endif
512#ifdef ECONNABORTED
513 inscode(d, ds, de, "ECONNABORTED", ECONNABORTED, "Software caused connection abort");
514#else
515#ifdef WSAECONNABORTED
516 inscode(d, ds, de, "ECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
517#endif
518#endif
519#ifdef ENETUNREACH
520 inscode(d, ds, de, "ENETUNREACH", ENETUNREACH, "Network is unreachable");
521#else
522#ifdef WSAENETUNREACH
523 inscode(d, ds, de, "ENETUNREACH", WSAENETUNREACH, "Network is unreachable");
524#endif
525#endif
526#ifdef ESTALE
527 inscode(d, ds, de, "ESTALE", ESTALE, "Stale NFS file handle");
528#else
529#ifdef WSAESTALE
530 inscode(d, ds, de, "ESTALE", WSAESTALE, "Stale NFS file handle");
531#endif
532#endif
533#ifdef ENOSR
534 inscode(d, ds, de, "ENOSR", ENOSR, "Out of streams resources");
535#endif
536#ifdef ENOMEM
537 inscode(d, ds, de, "ENOMEM", ENOMEM, "Out of memory");
538#endif
539#ifdef ENOTSOCK
540 inscode(d, ds, de, "ENOTSOCK", ENOTSOCK, "Socket operation on non-socket");
541#else
542#ifdef WSAENOTSOCK
543 inscode(d, ds, de, "ENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
544#endif
545#endif
546#ifdef ESTRPIPE
547 inscode(d, ds, de, "ESTRPIPE", ESTRPIPE, "Streams pipe error");
548#endif
549#ifdef EMLINK
550 inscode(d, ds, de, "EMLINK", EMLINK, "Too many links");
551#endif
552#ifdef ERANGE
553 inscode(d, ds, de, "ERANGE", ERANGE, "Math result not representable");
554#endif
555#ifdef ELIBEXEC
556 inscode(d, ds, de, "ELIBEXEC", ELIBEXEC, "Cannot exec a shared library directly");
557#endif
558#ifdef EL3HLT
559 inscode(d, ds, de, "EL3HLT", EL3HLT, "Level 3 halted");
560#endif
561#ifdef ECONNRESET
562 inscode(d, ds, de, "ECONNRESET", ECONNRESET, "Connection reset by peer");
563#else
564#ifdef WSAECONNRESET
565 inscode(d, ds, de, "ECONNRESET", WSAECONNRESET, "Connection reset by peer");
566#endif
567#endif
568#ifdef EADDRINUSE
569 inscode(d, ds, de, "EADDRINUSE", EADDRINUSE, "Address already in use");
570#else
571#ifdef WSAEADDRINUSE
572 inscode(d, ds, de, "EADDRINUSE", WSAEADDRINUSE, "Address already in use");
573#endif
574#endif
575#ifdef EOPNOTSUPP
576 inscode(d, ds, de, "EOPNOTSUPP", EOPNOTSUPP, "Operation not supported on transport endpoint");
577#else
578#ifdef WSAEOPNOTSUPP
579 inscode(d, ds, de, "EOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
580#endif
581#endif
582#ifdef EREMCHG
583 inscode(d, ds, de, "EREMCHG", EREMCHG, "Remote address changed");
584#endif
585#ifdef EAGAIN
586 inscode(d, ds, de, "EAGAIN", EAGAIN, "Try again");
587#endif
588#ifdef ENAMETOOLONG
589 inscode(d, ds, de, "ENAMETOOLONG", ENAMETOOLONG, "File name too long");
590#else
591#ifdef WSAENAMETOOLONG
592 inscode(d, ds, de, "ENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
593#endif
594#endif
595#ifdef ENOTTY
596 inscode(d, ds, de, "ENOTTY", ENOTTY, "Not a typewriter");
597#endif
598#ifdef ERESTART
599 inscode(d, ds, de, "ERESTART", ERESTART, "Interrupted system call should be restarted");
600#endif
601#ifdef ESOCKTNOSUPPORT
602 inscode(d, ds, de, "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, "Socket type not supported");
603#else
604#ifdef WSAESOCKTNOSUPPORT
605 inscode(d, ds, de, "ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
606#endif
607#endif
608#ifdef ETIME
609 inscode(d, ds, de, "ETIME", ETIME, "Timer expired");
610#endif
611#ifdef EBFONT
612 inscode(d, ds, de, "EBFONT", EBFONT, "Bad font file format");
613#endif
614#ifdef EDEADLOCK
615 inscode(d, ds, de, "EDEADLOCK", EDEADLOCK, "Error EDEADLOCK");
616#endif
617#ifdef ETOOMANYREFS
618 inscode(d, ds, de, "ETOOMANYREFS", ETOOMANYREFS, "Too many references: cannot splice");
619#else
620#ifdef WSAETOOMANYREFS
621 inscode(d, ds, de, "ETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
622#endif
623#endif
624#ifdef EMFILE
625 inscode(d, ds, de, "EMFILE", EMFILE, "Too many open files");
626#else
627#ifdef WSAEMFILE
628 inscode(d, ds, de, "EMFILE", WSAEMFILE, "Too many open files");
629#endif
630#endif
631#ifdef ETXTBSY
632 inscode(d, ds, de, "ETXTBSY", ETXTBSY, "Text file busy");
633#endif
634#ifdef EINPROGRESS
635 inscode(d, ds, de, "EINPROGRESS", EINPROGRESS, "Operation now in progress");
636#else
637#ifdef WSAEINPROGRESS
638 inscode(d, ds, de, "EINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
639#endif
640#endif
641#ifdef ENXIO
642 inscode(d, ds, de, "ENXIO", ENXIO, "No such device or address");
643#endif
644#ifdef ENOPKG
645 inscode(d, ds, de, "ENOPKG", ENOPKG, "Package not installed");
646#endif
647#ifdef WSASY
648 inscode(d, ds, de, "WSASY", WSASY, "Error WSASY");
649#endif
650#ifdef WSAEHOSTDOWN
651 inscode(d, ds, de, "WSAEHOSTDOWN", WSAEHOSTDOWN, "Host is down");
652#endif
653#ifdef WSAENETDOWN
654 inscode(d, ds, de, "WSAENETDOWN", WSAENETDOWN, "Network is down");
655#endif
656#ifdef WSAENOTSOCK
657 inscode(d, ds, de, "WSAENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
658#endif
659#ifdef WSAEHOSTUNREACH
660 inscode(d, ds, de, "WSAEHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
661#endif
662#ifdef WSAELOOP
663 inscode(d, ds, de, "WSAELOOP", WSAELOOP, "Too many symbolic links encountered");
664#endif
665#ifdef WSAEMFILE
666 inscode(d, ds, de, "WSAEMFILE", WSAEMFILE, "Too many open files");
667#endif
668#ifdef WSAESTALE
669 inscode(d, ds, de, "WSAESTALE", WSAESTALE, "Stale NFS file handle");
670#endif
671#ifdef WSAVERNOTSUPPORTED
672 inscode(d, ds, de, "WSAVERNOTSUPPORTED", WSAVERNOTSUPPORTED, "Error WSAVERNOTSUPPORTED");
673#endif
674#ifdef WSAENETUNREACH
675 inscode(d, ds, de, "WSAENETUNREACH", WSAENETUNREACH, "Network is unreachable");
676#endif
677#ifdef WSAEPROCLIM
678 inscode(d, ds, de, "WSAEPROCLIM", WSAEPROCLIM, "Error WSAEPROCLIM");
679#endif
680#ifdef WSAEFAULT
681 inscode(d, ds, de, "WSAEFAULT", WSAEFAULT, "Bad address");
682#endif
683#ifdef WSANOTINITIALISED
684 inscode(d, ds, de, "WSANOTINITIALISED", WSANOTINITIALISED, "Error WSANOTINITIALISED");
685#endif
686#ifdef WSAEUSERS
687 inscode(d, ds, de, "WSAEUSERS", WSAEUSERS, "Too many users");
688#endif
689#ifdef WSAMAKEASYNCREPL
690 inscode(d, ds, de, "WSAMAKEASYNCREPL", WSAMAKEASYNCREPL, "Error WSAMAKEASYNCREPL");
691#endif
692#ifdef WSAENOPROTOOPT
693 inscode(d, ds, de, "WSAENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
694#endif
695#ifdef WSAECONNABORTED
696 inscode(d, ds, de, "WSAECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
697#endif
698#ifdef WSAENAMETOOLONG
699 inscode(d, ds, de, "WSAENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
700#endif
701#ifdef WSAENOTEMPTY
702 inscode(d, ds, de, "WSAENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
703#endif
704#ifdef WSAESHUTDOWN
705 inscode(d, ds, de, "WSAESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
706#endif
707#ifdef WSAEAFNOSUPPORT
708 inscode(d, ds, de, "WSAEAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
709#endif
710#ifdef WSAETOOMANYREFS
711 inscode(d, ds, de, "WSAETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
712#endif
713#ifdef WSAEACCES
714 inscode(d, ds, de, "WSAEACCES", WSAEACCES, "Permission denied");
715#endif
716#ifdef WSATR
717 inscode(d, ds, de, "WSATR", WSATR, "Error WSATR");
718#endif
719#ifdef WSABASEERR
720 inscode(d, ds, de, "WSABASEERR", WSABASEERR, "Error WSABASEERR");
721#endif
722#ifdef WSADESCRIPTIO
723 inscode(d, ds, de, "WSADESCRIPTIO", WSADESCRIPTIO, "Error WSADESCRIPTIO");
724#endif
725#ifdef WSAEMSGSIZE
726 inscode(d, ds, de, "WSAEMSGSIZE", WSAEMSGSIZE, "Message too long");
727#endif
728#ifdef WSAEBADF
729 inscode(d, ds, de, "WSAEBADF", WSAEBADF, "Bad file number");
730#endif
731#ifdef WSAECONNRESET
732 inscode(d, ds, de, "WSAECONNRESET", WSAECONNRESET, "Connection reset by peer");
733#endif
734#ifdef WSAGETSELECTERRO
735 inscode(d, ds, de, "WSAGETSELECTERRO", WSAGETSELECTERRO, "Error WSAGETSELECTERRO");
736#endif
737#ifdef WSAETIMEDOUT
738 inscode(d, ds, de, "WSAETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
739#endif
740#ifdef WSAENOBUFS
741 inscode(d, ds, de, "WSAENOBUFS", WSAENOBUFS, "No buffer space available");
742#endif
743#ifdef WSAEDISCON
744 inscode(d, ds, de, "WSAEDISCON", WSAEDISCON, "Error WSAEDISCON");
745#endif
746#ifdef WSAEINTR
747 inscode(d, ds, de, "WSAEINTR", WSAEINTR, "Interrupted system call");
748#endif
749#ifdef WSAEPROTOTYPE
750 inscode(d, ds, de, "WSAEPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
751#endif
752#ifdef WSAHOS
753 inscode(d, ds, de, "WSAHOS", WSAHOS, "Error WSAHOS");
754#endif
755#ifdef WSAEADDRINUSE
756 inscode(d, ds, de, "WSAEADDRINUSE", WSAEADDRINUSE, "Address already in use");
757#endif
758#ifdef WSAEADDRNOTAVAIL
759 inscode(d, ds, de, "WSAEADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
760#endif
761#ifdef WSAEALREADY
762 inscode(d, ds, de, "WSAEALREADY", WSAEALREADY, "Operation already in progress");
763#endif
764#ifdef WSAEPROTONOSUPPORT
765 inscode(d, ds, de, "WSAEPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
766#endif
767#ifdef WSASYSNOTREADY
768 inscode(d, ds, de, "WSASYSNOTREADY", WSASYSNOTREADY, "Error WSASYSNOTREADY");
769#endif
770#ifdef WSAEWOULDBLOCK
771 inscode(d, ds, de, "WSAEWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
772#endif
773#ifdef WSAEPFNOSUPPORT
774 inscode(d, ds, de, "WSAEPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
775#endif
776#ifdef WSAEOPNOTSUPP
777 inscode(d, ds, de, "WSAEOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
778#endif
779#ifdef WSAEISCONN
780 inscode(d, ds, de, "WSAEISCONN", WSAEISCONN, "Transport endpoint is already connected");
781#endif
782#ifdef WSAEDQUOT
783 inscode(d, ds, de, "WSAEDQUOT", WSAEDQUOT, "Quota exceeded");
784#endif
785#ifdef WSAENOTCONN
786 inscode(d, ds, de, "WSAENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
787#endif
788#ifdef WSAEREMOTE
789 inscode(d, ds, de, "WSAEREMOTE", WSAEREMOTE, "Object is remote");
790#endif
791#ifdef WSAEINVAL
792 inscode(d, ds, de, "WSAEINVAL", WSAEINVAL, "Invalid argument");
793#endif
794#ifdef WSAEINPROGRESS
795 inscode(d, ds, de, "WSAEINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
796#endif
797#ifdef WSAGETSELECTEVEN
798 inscode(d, ds, de, "WSAGETSELECTEVEN", WSAGETSELECTEVEN, "Error WSAGETSELECTEVEN");
799#endif
800#ifdef WSAESOCKTNOSUPPORT
801 inscode(d, ds, de, "WSAESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
802#endif
803#ifdef WSAGETASYNCERRO
804 inscode(d, ds, de, "WSAGETASYNCERRO", WSAGETASYNCERRO, "Error WSAGETASYNCERRO");
805#endif
806#ifdef WSAMAKESELECTREPL
807 inscode(d, ds, de, "WSAMAKESELECTREPL", WSAMAKESELECTREPL, "Error WSAMAKESELECTREPL");
808#endif
809#ifdef WSAGETASYNCBUFLE
810 inscode(d, ds, de, "WSAGETASYNCBUFLE", WSAGETASYNCBUFLE, "Error WSAGETASYNCBUFLE");
811#endif
812#ifdef WSAEDESTADDRREQ
813 inscode(d, ds, de, "WSAEDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
814#endif
815#ifdef WSAECONNREFUSED
816 inscode(d, ds, de, "WSAECONNREFUSED", WSAECONNREFUSED, "Connection refused");
817#endif
818#ifdef WSAENETRESET
819 inscode(d, ds, de, "WSAENETRESET", WSAENETRESET, "Network dropped connection because of reset");
820#endif
821#ifdef WSAN
822 inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
823#endif
824
Guido van Rossum4dc66221996-07-24 00:51:51 +0000825}