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