ยปCore Development>Code coverage>Modules/errnomodule.c

Python code coverage for Modules/errnomodule.c

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