Commit 49f9d8e4 authored by Guido van Rossum's avatar Guido van Rossum

Changes submitted by Marc-Andre Lemburg to add two tables: errorcode

maps errno numbers to errno names (e.g. EINTR), and errorcode maps
them to message strings.  (The latter is redundant because
the new call posix.strerror() now does the same, but alla...)
parent 4518823a
...@@ -38,6 +38,11 @@ PERFORMANCE OF THIS SOFTWARE. ...@@ -38,6 +38,11 @@ PERFORMANCE OF THIS SOFTWARE.
#include <sys/errno.h> #include <sys/errno.h>
#endif #endif
/* Windows socket errors (WSA*): XXX is this the correct path ??? */
#ifdef MS_WINDOWS
#include <winsock.h>
#endif
/* /*
* Pull in the system error definitions * Pull in the system error definitions
*/ */
...@@ -46,526 +51,775 @@ static PyMethodDef errno_methods[] = { ...@@ -46,526 +51,775 @@ static PyMethodDef errno_methods[] = {
{NULL, NULL} {NULL, NULL}
}; };
/* /* Helper function doing the dictionary inserting */
* Convenience routine to export an integer value.
* For simplicity, errors (which are unlikely anyway) are ignored.
*/
static void static void
insint(d, name, value) inscode(d, e, c, name, code, comment)
PyObject * d; PyObject * d;
char * name; PyObject * e;
int value; PyObject * c;
char *name;
int code;
char * comment;
{ {
PyObject *v = PyInt_FromLong((long) value); PyObject *u;
if (v == NULL) { PyObject *v;
PyObject *w;
#ifdef HAVE_STRERROR
if (strerror(code) != NULL)
comment = strerror(code);
#endif
u = PyString_FromString(name);
v = PyInt_FromLong((long) code);
w = PyString_FromString(comment);
if (!u || !v || !w) {
/* Don't bother reporting this error */ /* Don't bother reporting this error */
PyErr_Clear(); PyErr_Clear();
} }
else { else {
PyDict_SetItemString(d, name, v); /* insert in modules dict */
Py_DECREF(v); PyDict_SetItem(d, u, v);
/* insert in errorstr dict */
PyDict_SetItem(e, v, w);
/* insert in errorcode dict */
PyDict_SetItem(c, v, u);
} }
Py_XDECREF(u);
Py_XDECREF(v);
Py_XDECREF(w);
} }
void void
initerrno() initerrno()
{ {
PyObject *m, *d; PyObject *m, *d, *ds, *de;
m = Py_InitModule("errno", errno_methods); m = Py_InitModule("errno", errno_methods);
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
ds = PyDict_New();
if (ds == NULL || PyDict_SetItemString(d,"errorstr",ds))
Py_FatalError("can't initialize errno module");
de = PyDict_New();
if (de == NULL || PyDict_SetItemString(d,"errorcode",de))
Py_FatalError("can't initialize errno module");
/* /*
* The names and comments are borrowed from linux/include/errno.h, * The names and comments are borrowed from linux/include/errno.h,
* which should be pretty all-inclusive * which should be pretty all-inclusive
*/ */
#ifdef EPERM #ifdef ENODEV
/* Operation not permitted */ inscode(d, ds, de, "ENODEV", ENODEV, "No such device");
insint(d, "EPERM", EPERM);
#endif #endif
#ifdef ENOENT #ifdef ENOCSI
/* No such file or directory */ inscode(d, ds, de, "ENOCSI", ENOCSI, "No CSI structure available");
insint(d, "ENOENT", ENOENT);
#endif #endif
#ifdef ESRCH #ifdef EHOSTUNREACH
/* No such process */ inscode(d, ds, de, "EHOSTUNREACH", EHOSTUNREACH, "No route to host");
insint(d, "ESRCH", ESRCH); #else
#ifdef WSAEHOSTUNREACH
inscode(d, ds, de, "EHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
#endif
#endif
#ifdef ENOMSG
inscode(d, ds, de, "ENOMSG", ENOMSG, "No message of desired type");
#endif
#ifdef EUCLEAN
inscode(d, ds, de, "EUCLEAN", EUCLEAN, "Structure needs cleaning");
#endif
#ifdef EL2NSYNC
inscode(d, ds, de, "EL2NSYNC", EL2NSYNC, "Level 2 not synchronized");
#endif
#ifdef EL2HLT
inscode(d, ds, de, "EL2HLT", EL2HLT, "Level 2 halted");
#endif
#ifdef ENODATA
inscode(d, ds, de, "ENODATA", ENODATA, "No data available");
#endif
#ifdef ENOTBLK
inscode(d, ds, de, "ENOTBLK", ENOTBLK, "Block device required");
#endif
#ifdef ENOSYS
inscode(d, ds, de, "ENOSYS", ENOSYS, "Function not implemented");
#endif
#ifdef EPIPE
inscode(d, ds, de, "EPIPE", EPIPE, "Broken pipe");
#endif
#ifdef EINVAL
inscode(d, ds, de, "EINVAL", EINVAL, "Invalid argument");
#else
#ifdef WSAEINVAL
inscode(d, ds, de, "EINVAL", WSAEINVAL, "Invalid argument");
#endif
#endif
#ifdef EOVERFLOW
inscode(d, ds, de, "EOVERFLOW", EOVERFLOW, "Value too large for defined data type");
#endif
#ifdef EADV
inscode(d, ds, de, "EADV", EADV, "Advertise error");
#endif #endif
#ifdef EINTR #ifdef EINTR
/* Interrupted system call */ inscode(d, ds, de, "EINTR", EINTR, "Interrupted system call");
insint(d, "EINTR", EINTR); #else
#ifdef WSAEINTR
inscode(d, ds, de, "EINTR", WSAEINTR, "Interrupted system call");
#endif #endif
#ifdef EIO
/* I/O error */
insint(d, "EIO", EIO);
#endif #endif
#ifdef ENXIO #ifdef EUSERS
/* No such device or address */ inscode(d, ds, de, "EUSERS", EUSERS, "Too many users");
insint(d, "ENXIO", ENXIO); #else
#ifdef WSAEUSERS
inscode(d, ds, de, "EUSERS", WSAEUSERS, "Too many users");
#endif #endif
#ifdef E2BIG
/* Arg list too long */
insint(d, "E2BIG", E2BIG);
#endif #endif
#ifdef ENOEXEC #ifdef ENOTEMPTY
/* Exec format error */ inscode(d, ds, de, "ENOTEMPTY", ENOTEMPTY, "Directory not empty");
insint(d, "ENOEXEC", ENOEXEC); #else
#ifdef WSAENOTEMPTY
inscode(d, ds, de, "ENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
#endif
#endif
#ifdef ENOBUFS
inscode(d, ds, de, "ENOBUFS", ENOBUFS, "No buffer space available");
#else
#ifdef WSAENOBUFS
inscode(d, ds, de, "ENOBUFS", WSAENOBUFS, "No buffer space available");
#endif
#endif
#ifdef EPROTO
inscode(d, ds, de, "EPROTO", EPROTO, "Protocol error");
#endif
#ifdef EREMOTE
inscode(d, ds, de, "EREMOTE", EREMOTE, "Object is remote");
#else
#ifdef WSAEREMOTE
inscode(d, ds, de, "EREMOTE", WSAEREMOTE, "Object is remote");
#endif #endif
#ifdef EBADF #endif
/* Bad file number */ #ifdef ENAVAIL
insint(d, "EBADF", EBADF); inscode(d, ds, de, "ENAVAIL", ENAVAIL, "No XENIX semaphores available");
#endif #endif
#ifdef ECHILD #ifdef ECHILD
/* No child processes */ inscode(d, ds, de, "ECHILD", ECHILD, "No child processes");
insint(d, "ECHILD", ECHILD);
#endif #endif
#ifdef EAGAIN #ifdef ELOOP
/* Try again */ inscode(d, ds, de, "ELOOP", ELOOP, "Too many symbolic links encountered");
insint(d, "EAGAIN", EAGAIN); #else
#ifdef WSAELOOP
inscode(d, ds, de, "ELOOP", WSAELOOP, "Too many symbolic links encountered");
#endif #endif
#ifdef ENOMEM
/* Out of memory */
insint(d, "ENOMEM", ENOMEM);
#endif #endif
#ifdef EACCES #ifdef EXDEV
/* Permission denied */ inscode(d, ds, de, "EXDEV", EXDEV, "Cross-device link");
insint(d, "EACCES", EACCES);
#endif #endif
#ifdef EFAULT #ifdef E2BIG
/* Bad address */ inscode(d, ds, de, "E2BIG", E2BIG, "Arg list too long");
insint(d, "EFAULT", EFAULT); #endif
#ifdef ESRCH
inscode(d, ds, de, "ESRCH", ESRCH, "No such process");
#endif
#ifdef EMSGSIZE
inscode(d, ds, de, "EMSGSIZE", EMSGSIZE, "Message too long");
#else
#ifdef WSAEMSGSIZE
inscode(d, ds, de, "EMSGSIZE", WSAEMSGSIZE, "Message too long");
#endif
#endif
#ifdef EAFNOSUPPORT
inscode(d, ds, de, "EAFNOSUPPORT", EAFNOSUPPORT, "Address family not supported by protocol");
#else
#ifdef WSAEAFNOSUPPORT
inscode(d, ds, de, "EAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
#endif
#endif
#ifdef EBADR
inscode(d, ds, de, "EBADR", EBADR, "Invalid request descriptor");
#endif
#ifdef EHOSTDOWN
inscode(d, ds, de, "EHOSTDOWN", EHOSTDOWN, "Host is down");
#else
#ifdef WSAEHOSTDOWN
inscode(d, ds, de, "EHOSTDOWN", WSAEHOSTDOWN, "Host is down");
#endif
#endif
#ifdef EPFNOSUPPORT
inscode(d, ds, de, "EPFNOSUPPORT", EPFNOSUPPORT, "Protocol family not supported");
#else
#ifdef WSAEPFNOSUPPORT
inscode(d, ds, de, "EPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
#endif
#endif
#ifdef ENOPROTOOPT
inscode(d, ds, de, "ENOPROTOOPT", ENOPROTOOPT, "Protocol not available");
#else
#ifdef WSAENOPROTOOPT
inscode(d, ds, de, "ENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
#endif #endif
#ifdef ENOTBLK
/* Block device required */
insint(d, "ENOTBLK", ENOTBLK);
#endif #endif
#ifdef EBUSY #ifdef EBUSY
/* Device or resource busy */ inscode(d, ds, de, "EBUSY", EBUSY, "Device or resource busy");
insint(d, "EBUSY", EBUSY);
#endif #endif
#ifdef EEXIST #ifdef EWOULDBLOCK
/* File exists */ inscode(d, ds, de, "EWOULDBLOCK", EWOULDBLOCK, "Operation would block");
insint(d, "EEXIST", EEXIST); #else
#ifdef WSAEWOULDBLOCK
inscode(d, ds, de, "EWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
#endif #endif
#ifdef EXDEV
/* Cross-device link */
insint(d, "EXDEV", EXDEV);
#endif #endif
#ifdef ENODEV #ifdef EBADFD
/* No such device */ inscode(d, ds, de, "EBADFD", EBADFD, "File descriptor in bad state");
insint(d, "ENODEV", ENODEV); #endif
#ifdef EDOTDOT
inscode(d, ds, de, "EDOTDOT", EDOTDOT, "RFS specific error");
#endif
#ifdef EISCONN
inscode(d, ds, de, "EISCONN", EISCONN, "Transport endpoint is already connected");
#else
#ifdef WSAEISCONN
inscode(d, ds, de, "EISCONN", WSAEISCONN, "Transport endpoint is already connected");
#endif
#endif
#ifdef ENOANO
inscode(d, ds, de, "ENOANO", ENOANO, "No anode");
#endif
#ifdef ESHUTDOWN
inscode(d, ds, de, "ESHUTDOWN", ESHUTDOWN, "Cannot send after transport endpoint shutdown");
#else
#ifdef WSAESHUTDOWN
inscode(d, ds, de, "ESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
#endif
#endif
#ifdef ECHRNG
inscode(d, ds, de, "ECHRNG", ECHRNG, "Channel number out of range");
#endif
#ifdef ELIBBAD
inscode(d, ds, de, "ELIBBAD", ELIBBAD, "Accessing a corrupted shared library");
#endif
#ifdef ENONET
inscode(d, ds, de, "ENONET", ENONET, "Machine is not on the network");
#endif
#ifdef EBADE
inscode(d, ds, de, "EBADE", EBADE, "Invalid exchange");
#endif
#ifdef EBADF
inscode(d, ds, de, "EBADF", EBADF, "Bad file number");
#else
#ifdef WSAEBADF
inscode(d, ds, de, "EBADF", WSAEBADF, "Bad file number");
#endif
#endif
#ifdef EMULTIHOP
inscode(d, ds, de, "EMULTIHOP", EMULTIHOP, "Multihop attempted");
#endif
#ifdef EIO
inscode(d, ds, de, "EIO", EIO, "I/O error");
#endif
#ifdef EUNATCH
inscode(d, ds, de, "EUNATCH", EUNATCH, "Protocol driver not attached");
#endif
#ifdef EPROTOTYPE
inscode(d, ds, de, "EPROTOTYPE", EPROTOTYPE, "Protocol wrong type for socket");
#else
#ifdef WSAEPROTOTYPE
inscode(d, ds, de, "EPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
#endif
#endif
#ifdef ENOSPC
inscode(d, ds, de, "ENOSPC", ENOSPC, "No space left on device");
#endif
#ifdef ENOEXEC
inscode(d, ds, de, "ENOEXEC", ENOEXEC, "Exec format error");
#endif
#ifdef EALREADY
inscode(d, ds, de, "EALREADY", EALREADY, "Operation already in progress");
#else
#ifdef WSAEALREADY
inscode(d, ds, de, "EALREADY", WSAEALREADY, "Operation already in progress");
#endif
#endif
#ifdef ENETDOWN
inscode(d, ds, de, "ENETDOWN", ENETDOWN, "Network is down");
#else
#ifdef WSAENETDOWN
inscode(d, ds, de, "ENETDOWN", WSAENETDOWN, "Network is down");
#endif
#endif
#ifdef ENOTNAM
inscode(d, ds, de, "ENOTNAM", ENOTNAM, "Not a XENIX named type file");
#endif
#ifdef EACCES
inscode(d, ds, de, "EACCES", EACCES, "Permission denied");
#else
#ifdef WSAEACCES
inscode(d, ds, de, "EACCES", WSAEACCES, "Permission denied");
#endif
#endif
#ifdef ELNRNG
inscode(d, ds, de, "ELNRNG", ELNRNG, "Link number out of range");
#endif
#ifdef EILSEQ
inscode(d, ds, de, "EILSEQ", EILSEQ, "Illegal byte sequence");
#endif #endif
#ifdef ENOTDIR #ifdef ENOTDIR
/* Not a directory */ inscode(d, ds, de, "ENOTDIR", ENOTDIR, "Not a directory");
insint(d, "ENOTDIR", ENOTDIR); #endif
#ifdef ENOTUNIQ
inscode(d, ds, de, "ENOTUNIQ", ENOTUNIQ, "Name not unique on network");
#endif
#ifdef EPERM
inscode(d, ds, de, "EPERM", EPERM, "Operation not permitted");
#endif
#ifdef EDOM
inscode(d, ds, de, "EDOM", EDOM, "Math argument out of domain of func");
#endif
#ifdef EXFULL
inscode(d, ds, de, "EXFULL", EXFULL, "Exchange full");
#endif
#ifdef ECONNREFUSED
inscode(d, ds, de, "ECONNREFUSED", ECONNREFUSED, "Connection refused");
#else
#ifdef WSAECONNREFUSED
inscode(d, ds, de, "ECONNREFUSED", WSAECONNREFUSED, "Connection refused");
#endif
#endif #endif
#ifdef EISDIR #ifdef EISDIR
/* Is a directory */ inscode(d, ds, de, "EISDIR", EISDIR, "Is a directory");
insint(d, "EISDIR", EISDIR);
#endif #endif
#ifdef EINVAL #ifdef EPROTONOSUPPORT
/* Invalid argument */ inscode(d, ds, de, "EPROTONOSUPPORT", EPROTONOSUPPORT, "Protocol not supported");
insint(d, "EINVAL", EINVAL); #else
#ifdef WSAEPROTONOSUPPORT
inscode(d, ds, de, "EPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
#endif #endif
#ifdef ENFILE
/* File table overflow */
insint(d, "ENFILE", ENFILE);
#endif #endif
#ifdef EMFILE #ifdef EROFS
/* Too many open files */ inscode(d, ds, de, "EROFS", EROFS, "Read-only file system");
insint(d, "EMFILE", EMFILE);
#endif #endif
#ifdef ENOTTY #ifdef EADDRNOTAVAIL
/* Not a typewriter */ inscode(d, ds, de, "EADDRNOTAVAIL", EADDRNOTAVAIL, "Cannot assign requested address");
insint(d, "ENOTTY", ENOTTY); #else
#ifdef WSAEADDRNOTAVAIL
inscode(d, ds, de, "EADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
#endif #endif
#ifdef ETXTBSY
/* Text file busy */
insint(d, "ETXTBSY", ETXTBSY);
#endif #endif
#ifdef EFBIG #ifdef EIDRM
/* File too large */ inscode(d, ds, de, "EIDRM", EIDRM, "Identifier removed");
insint(d, "EFBIG", EFBIG);
#endif #endif
#ifdef ENOSPC #ifdef ECOMM
/* No space left on device */ inscode(d, ds, de, "ECOMM", ECOMM, "Communication error on send");
insint(d, "ENOSPC", ENOSPC); #endif
#ifdef ESRMNT
inscode(d, ds, de, "ESRMNT", ESRMNT, "Srmount error");
#endif
#ifdef EREMOTEIO
inscode(d, ds, de, "EREMOTEIO", EREMOTEIO, "Remote I/O error");
#endif
#ifdef EL3RST
inscode(d, ds, de, "EL3RST", EL3RST, "Level 3 reset");
#endif
#ifdef EBADMSG
inscode(d, ds, de, "EBADMSG", EBADMSG, "Not a data message");
#endif
#ifdef ENFILE
inscode(d, ds, de, "ENFILE", ENFILE, "File table overflow");
#endif
#ifdef ELIBMAX
inscode(d, ds, de, "ELIBMAX", ELIBMAX, "Attempting to link in too many shared libraries");
#endif #endif
#ifdef ESPIPE #ifdef ESPIPE
/* Illegal seek */ inscode(d, ds, de, "ESPIPE", ESPIPE, "Illegal seek");
insint(d, "ESPIPE", ESPIPE);
#endif #endif
#ifdef EROFS #ifdef ENOLINK
/* Read-only file system */ inscode(d, ds, de, "ENOLINK", ENOLINK, "Link has been severed");
insint(d, "EROFS", EROFS);
#endif #endif
#ifdef EMLINK #ifdef ENETRESET
/* Too many links */ inscode(d, ds, de, "ENETRESET", ENETRESET, "Network dropped connection because of reset");
insint(d, "EMLINK", EMLINK); #else
#ifdef WSAENETRESET
inscode(d, ds, de, "ENETRESET", WSAENETRESET, "Network dropped connection because of reset");
#endif #endif
#ifdef EPIPE
/* Broken pipe */
insint(d, "EPIPE", EPIPE);
#endif #endif
#ifdef EDOM #ifdef ETIMEDOUT
/* Math argument out of domain of func */ inscode(d, ds, de, "ETIMEDOUT", ETIMEDOUT, "Connection timed out");
insint(d, "EDOM", EDOM); #else
#ifdef WSAETIMEDOUT
inscode(d, ds, de, "ETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
#endif #endif
#ifdef ERANGE #endif
/* Math result not representable */ #ifdef ENOENT
insint(d, "ERANGE", ERANGE); inscode(d, ds, de, "ENOENT", ENOENT, "No such file or directory");
#endif
#ifdef EEXIST
inscode(d, ds, de, "EEXIST", EEXIST, "File exists");
#endif
#ifdef EDQUOT
inscode(d, ds, de, "EDQUOT", EDQUOT, "Quota exceeded");
#else
#ifdef WSAEDQUOT
inscode(d, ds, de, "EDQUOT", WSAEDQUOT, "Quota exceeded");
#endif
#endif
#ifdef ENOSTR
inscode(d, ds, de, "ENOSTR", ENOSTR, "Device not a stream");
#endif
#ifdef EBADSLT
inscode(d, ds, de, "EBADSLT", EBADSLT, "Invalid slot");
#endif
#ifdef EBADRQC
inscode(d, ds, de, "EBADRQC", EBADRQC, "Invalid request code");
#endif
#ifdef ELIBACC
inscode(d, ds, de, "ELIBACC", ELIBACC, "Can not access a needed shared library");
#endif
#ifdef EFAULT
inscode(d, ds, de, "EFAULT", EFAULT, "Bad address");
#else
#ifdef WSAEFAULT
inscode(d, ds, de, "EFAULT", WSAEFAULT, "Bad address");
#endif
#endif
#ifdef EFBIG
inscode(d, ds, de, "EFBIG", EFBIG, "File too large");
#endif #endif
#ifdef EDEADLK #ifdef EDEADLK
/* Resource deadlock would occur */ inscode(d, ds, de, "EDEADLK", EDEADLK, "Resource deadlock would occur");
insint(d, "EDEADLK", EDEADLK);
#endif #endif
#ifdef ENAMETOOLONG #ifdef ENOTCONN
/* File name too long */ inscode(d, ds, de, "ENOTCONN", ENOTCONN, "Transport endpoint is not connected");
insint(d, "ENAMETOOLONG", ENAMETOOLONG); #else
#ifdef WSAENOTCONN
inscode(d, ds, de, "ENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
#endif
#endif
#ifdef EDESTADDRREQ
inscode(d, ds, de, "EDESTADDRREQ", EDESTADDRREQ, "Destination address required");
#else
#ifdef WSAEDESTADDRREQ
inscode(d, ds, de, "EDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
#endif
#endif
#ifdef ELIBSCN
inscode(d, ds, de, "ELIBSCN", ELIBSCN, ".lib section in a.out corrupted");
#endif #endif
#ifdef ENOLCK #ifdef ENOLCK
/* No record locks available */ inscode(d, ds, de, "ENOLCK", ENOLCK, "No record locks available");
insint(d, "ENOLCK", ENOLCK);
#endif #endif
#ifdef ENOSYS #ifdef EISNAM
/* Function not implemented */ inscode(d, ds, de, "EISNAM", EISNAM, "Is a named type file");
insint(d, "ENOSYS", ENOSYS);
#endif #endif
#ifdef ENOTEMPTY #ifdef ECONNABORTED
/* Directory not empty */ inscode(d, ds, de, "ECONNABORTED", ECONNABORTED, "Software caused connection abort");
insint(d, "ENOTEMPTY", ENOTEMPTY); #else
#ifdef WSAECONNABORTED
inscode(d, ds, de, "ECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
#endif #endif
#ifdef ELOOP
/* Too many symbolic links encountered */
insint(d, "ELOOP", ELOOP);
#endif #endif
#ifdef EWOULDBLOCK #ifdef ENETUNREACH
/* Operation would block */ inscode(d, ds, de, "ENETUNREACH", ENETUNREACH, "Network is unreachable");
insint(d, "EWOULDBLOCK", EWOULDBLOCK); #else
#ifdef WSAENETUNREACH
inscode(d, ds, de, "ENETUNREACH", WSAENETUNREACH, "Network is unreachable");
#endif #endif
#ifdef ENOMSG
/* No message of desired type */
insint(d, "ENOMSG", ENOMSG);
#endif #endif
#ifdef EIDRM #ifdef ESTALE
/* Identifier removed */ inscode(d, ds, de, "ESTALE", ESTALE, "Stale NFS file handle");
insint(d, "EIDRM", EIDRM); #else
#ifdef WSAESTALE
inscode(d, ds, de, "ESTALE", WSAESTALE, "Stale NFS file handle");
#endif #endif
#ifdef ECHRNG
/* Channel number out of range */
insint(d, "ECHRNG", ECHRNG);
#endif #endif
#ifdef EL2NSYNC #ifdef ENOSR
/* Level 2 not synchronized */ inscode(d, ds, de, "ENOSR", ENOSR, "Out of streams resources");
insint(d, "EL2NSYNC", EL2NSYNC); #endif
#ifdef ENOMEM
inscode(d, ds, de, "ENOMEM", ENOMEM, "Out of memory");
#endif
#ifdef ENOTSOCK
inscode(d, ds, de, "ENOTSOCK", ENOTSOCK, "Socket operation on non-socket");
#else
#ifdef WSAENOTSOCK
inscode(d, ds, de, "ENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
#endif
#endif
#ifdef ESTRPIPE
inscode(d, ds, de, "ESTRPIPE", ESTRPIPE, "Streams pipe error");
#endif
#ifdef EMLINK
inscode(d, ds, de, "EMLINK", EMLINK, "Too many links");
#endif
#ifdef ERANGE
inscode(d, ds, de, "ERANGE", ERANGE, "Math result not representable");
#endif
#ifdef ELIBEXEC
inscode(d, ds, de, "ELIBEXEC", ELIBEXEC, "Cannot exec a shared library directly");
#endif #endif
#ifdef EL3HLT #ifdef EL3HLT
/* Level 3 halted */ inscode(d, ds, de, "EL3HLT", EL3HLT, "Level 3 halted");
insint(d, "EL3HLT", EL3HLT);
#endif #endif
#ifdef EL3RST #ifdef ECONNRESET
/* Level 3 reset */ inscode(d, ds, de, "ECONNRESET", ECONNRESET, "Connection reset by peer");
insint(d, "EL3RST", EL3RST); #else
#ifdef WSAECONNRESET
inscode(d, ds, de, "ECONNRESET", WSAECONNRESET, "Connection reset by peer");
#endif #endif
#ifdef ELNRNG
/* Link number out of range */
insint(d, "ELNRNG", ELNRNG);
#endif #endif
#ifdef EUNATCH #ifdef EADDRINUSE
/* Protocol driver not attached */ inscode(d, ds, de, "EADDRINUSE", EADDRINUSE, "Address already in use");
insint(d, "EUNATCH", EUNATCH); #else
#ifdef WSAEADDRINUSE
inscode(d, ds, de, "EADDRINUSE", WSAEADDRINUSE, "Address already in use");
#endif #endif
#ifdef ENOCSI
/* No CSI structure available */
insint(d, "ENOCSI", ENOCSI);
#endif #endif
#ifdef EL2HLT #ifdef EOPNOTSUPP
/* Level 2 halted */ inscode(d, ds, de, "EOPNOTSUPP", EOPNOTSUPP, "Operation not supported on transport endpoint");
insint(d, "EL2HLT", EL2HLT); #else
#ifdef WSAEOPNOTSUPP
inscode(d, ds, de, "EOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
#endif #endif
#ifdef EBADE
/* Invalid exchange */
insint(d, "EBADE", EBADE);
#endif #endif
#ifdef EBADR #ifdef EREMCHG
/* Invalid request descriptor */ inscode(d, ds, de, "EREMCHG", EREMCHG, "Remote address changed");
insint(d, "EBADR", EBADR);
#endif #endif
#ifdef EXFULL #ifdef EAGAIN
/* Exchange full */ inscode(d, ds, de, "EAGAIN", EAGAIN, "Try again");
insint(d, "EXFULL", EXFULL);
#endif #endif
#ifdef ENOANO #ifdef ENAMETOOLONG
/* No anode */ inscode(d, ds, de, "ENAMETOOLONG", ENAMETOOLONG, "File name too long");
insint(d, "ENOANO", ENOANO); #else
#ifdef WSAENAMETOOLONG
inscode(d, ds, de, "ENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
#endif #endif
#ifdef EBADRQC
/* Invalid request code */
insint(d, "EBADRQC", EBADRQC);
#endif #endif
#ifdef EBADSLT #ifdef ENOTTY
/* Invalid slot */ inscode(d, ds, de, "ENOTTY", ENOTTY, "Not a typewriter");
insint(d, "EBADSLT", EBADSLT); #endif
#ifdef ERESTART
inscode(d, ds, de, "ERESTART", ERESTART, "Interrupted system call should be restarted");
#endif
#ifdef ESOCKTNOSUPPORT
inscode(d, ds, de, "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, "Socket type not supported");
#else
#ifdef WSAESOCKTNOSUPPORT
inscode(d, ds, de, "ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
#endif #endif
#ifdef EDEADLOCK #endif
/* File locking deadlock error */ #ifdef ETIME
insint(d, "EDEADLOCK", EDEADLOCK); inscode(d, ds, de, "ETIME", ETIME, "Timer expired");
#endif #endif
#ifdef EBFONT #ifdef EBFONT
/* Bad font file format */ inscode(d, ds, de, "EBFONT", EBFONT, "Bad font file format");
insint(d, "EBFONT", EBFONT);
#endif #endif
#ifdef ENOSTR #ifdef EDEADLOCK
/* Device not a stream */ inscode(d, ds, de, "EDEADLOCK", EDEADLOCK, "Error EDEADLOCK");
insint(d, "ENOSTR", ENOSTR);
#endif #endif
#ifdef ENODATA #ifdef ETOOMANYREFS
/* No data available */ inscode(d, ds, de, "ETOOMANYREFS", ETOOMANYREFS, "Too many references: cannot splice");
insint(d, "ENODATA", ENODATA); #else
#ifdef WSAETOOMANYREFS
inscode(d, ds, de, "ETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
#endif #endif
#ifdef ETIME
/* Timer expired */
insint(d, "ETIME", ETIME);
#endif #endif
#ifdef ENOSR #ifdef EMFILE
/* Out of streams resources */ inscode(d, ds, de, "EMFILE", EMFILE, "Too many open files");
insint(d, "ENOSR", ENOSR); #else
#ifdef WSAEMFILE
inscode(d, ds, de, "EMFILE", WSAEMFILE, "Too many open files");
#endif
#endif
#ifdef ETXTBSY
inscode(d, ds, de, "ETXTBSY", ETXTBSY, "Text file busy");
#endif
#ifdef EINPROGRESS
inscode(d, ds, de, "EINPROGRESS", EINPROGRESS, "Operation now in progress");
#else
#ifdef WSAEINPROGRESS
inscode(d, ds, de, "EINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
#endif #endif
#ifdef ENONET #endif
/* Machine is not on the network */ #ifdef ENXIO
insint(d, "ENONET", ENONET); inscode(d, ds, de, "ENXIO", ENXIO, "No such device or address");
#endif #endif
#ifdef ENOPKG #ifdef ENOPKG
/* Package not installed */ inscode(d, ds, de, "ENOPKG", ENOPKG, "Package not installed");
insint(d, "ENOPKG", ENOPKG);
#endif #endif
#ifdef EREMOTE #ifdef WSASY
/* Object is remote */ inscode(d, ds, de, "WSASY", WSASY, "Error WSASY");
insint(d, "EREMOTE", EREMOTE);
#endif #endif
#ifdef ENOLINK #ifdef WSAEHOSTDOWN
/* Link has been severed */ inscode(d, ds, de, "WSAEHOSTDOWN", WSAEHOSTDOWN, "Host is down");
insint(d, "ENOLINK", ENOLINK);
#endif #endif
#ifdef EADV #ifdef WSAENETDOWN
/* Advertise error */ inscode(d, ds, de, "WSAENETDOWN", WSAENETDOWN, "Network is down");
insint(d, "EADV", EADV);
#endif #endif
#ifdef ESRMNT #ifdef WSAENOTSOCK
/* Srmount error */ inscode(d, ds, de, "WSAENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
insint(d, "ESRMNT", ESRMNT);
#endif #endif
#ifdef ECOMM #ifdef WSAEHOSTUNREACH
/* Communication error on send */ inscode(d, ds, de, "WSAEHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
insint(d, "ECOMM", ECOMM);
#endif #endif
#ifdef EPROTO #ifdef WSAELOOP
/* Protocol error */ inscode(d, ds, de, "WSAELOOP", WSAELOOP, "Too many symbolic links encountered");
insint(d, "EPROTO", EPROTO);
#endif #endif
#ifdef EMULTIHOP #ifdef WSAEMFILE
/* Multihop attempted */ inscode(d, ds, de, "WSAEMFILE", WSAEMFILE, "Too many open files");
insint(d, "EMULTIHOP", EMULTIHOP);
#endif #endif
#ifdef EDOTDOT #ifdef WSAESTALE
/* RFS specific error */ inscode(d, ds, de, "WSAESTALE", WSAESTALE, "Stale NFS file handle");
insint(d, "EDOTDOT", EDOTDOT);
#endif #endif
#ifdef EBADMSG #ifdef WSAVERNOTSUPPORTED
/* Not a data message */ inscode(d, ds, de, "WSAVERNOTSUPPORTED", WSAVERNOTSUPPORTED, "Error WSAVERNOTSUPPORTED");
insint(d, "EBADMSG", EBADMSG);
#endif #endif
#ifdef EOVERFLOW #ifdef WSAENETUNREACH
/* Value too large for defined data type */ inscode(d, ds, de, "WSAENETUNREACH", WSAENETUNREACH, "Network is unreachable");
insint(d, "EOVERFLOW", EOVERFLOW);
#endif #endif
#ifdef ENOTUNIQ #ifdef WSAEPROCLIM
/* Name not unique on network */ inscode(d, ds, de, "WSAEPROCLIM", WSAEPROCLIM, "Error WSAEPROCLIM");
insint(d, "ENOTUNIQ", ENOTUNIQ);
#endif #endif
#ifdef EBADFD #ifdef WSAEFAULT
/* File descriptor in bad state */ inscode(d, ds, de, "WSAEFAULT", WSAEFAULT, "Bad address");
insint(d, "EBADFD", EBADFD);
#endif #endif
#ifdef EREMCHG #ifdef WSANOTINITIALISED
/* Remote address changed */ inscode(d, ds, de, "WSANOTINITIALISED", WSANOTINITIALISED, "Error WSANOTINITIALISED");
insint(d, "EREMCHG", EREMCHG);
#endif #endif
#ifdef ELIBACC #ifdef WSAEUSERS
/* Can not access a needed shared library */ inscode(d, ds, de, "WSAEUSERS", WSAEUSERS, "Too many users");
insint(d, "ELIBACC", ELIBACC);
#endif #endif
#ifdef ELIBBAD #ifdef WSAMAKEASYNCREPL
/* Accessing a corrupted shared library */ inscode(d, ds, de, "WSAMAKEASYNCREPL", WSAMAKEASYNCREPL, "Error WSAMAKEASYNCREPL");
insint(d, "ELIBBAD", ELIBBAD);
#endif #endif
#ifdef ELIBSCN #ifdef WSAENOPROTOOPT
/* .lib section in a.out corrupted */ inscode(d, ds, de, "WSAENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
insint(d, "ELIBSCN", ELIBSCN);
#endif #endif
#ifdef ELIBMAX #ifdef WSAECONNABORTED
/* Attempting to link in too many shared libraries */ inscode(d, ds, de, "WSAECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
insint(d, "ELIBMAX", ELIBMAX);
#endif #endif
#ifdef ELIBEXEC #ifdef WSAENAMETOOLONG
/* Cannot exec a shared library directly */ inscode(d, ds, de, "WSAENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
insint(d, "ELIBEXEC", ELIBEXEC);
#endif #endif
#ifdef EILSEQ #ifdef WSAENOTEMPTY
/* Illegal byte sequence */ inscode(d, ds, de, "WSAENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
insint(d, "EILSEQ", EILSEQ);
#endif #endif
#ifdef ERESTART #ifdef WSAESHUTDOWN
/* Interrupted system call should be restarted */ inscode(d, ds, de, "WSAESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
insint(d, "ERESTART", ERESTART);
#endif #endif
#ifdef ESTRPIPE #ifdef WSAEAFNOSUPPORT
/* Streams pipe error */ inscode(d, ds, de, "WSAEAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
insint(d, "ESTRPIPE", ESTRPIPE);
#endif #endif
#ifdef EUSERS #ifdef WSAETOOMANYREFS
/* Too many users */ inscode(d, ds, de, "WSAETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
insint(d, "EUSERS", EUSERS);
#endif #endif
#ifdef ENOTSOCK #ifdef WSAEACCES
/* Socket operation on non-socket */ inscode(d, ds, de, "WSAEACCES", WSAEACCES, "Permission denied");
insint(d, "ENOTSOCK", ENOTSOCK);
#endif #endif
#ifdef EDESTADDRREQ #ifdef WSATR
/* Destination address required */ inscode(d, ds, de, "WSATR", WSATR, "Error WSATR");
insint(d, "EDESTADDRREQ", EDESTADDRREQ);
#endif #endif
#ifdef EMSGSIZE #ifdef WSABASEERR
/* Message too long */ inscode(d, ds, de, "WSABASEERR", WSABASEERR, "Error WSABASEERR");
insint(d, "EMSGSIZE", EMSGSIZE);
#endif #endif
#ifdef EPROTOTYPE #ifdef WSADESCRIPTIO
/* Protocol wrong type for socket */ inscode(d, ds, de, "WSADESCRIPTIO", WSADESCRIPTIO, "Error WSADESCRIPTIO");
insint(d, "EPROTOTYPE", EPROTOTYPE);
#endif #endif
#ifdef ENOPROTOOPT #ifdef WSAEMSGSIZE
/* Protocol not available */ inscode(d, ds, de, "WSAEMSGSIZE", WSAEMSGSIZE, "Message too long");
insint(d, "ENOPROTOOPT", ENOPROTOOPT);
#endif #endif
#ifdef EPROTONOSUPPORT #ifdef WSAEBADF
/* Protocol not supported */ inscode(d, ds, de, "WSAEBADF", WSAEBADF, "Bad file number");
insint(d, "EPROTONOSUPPORT", EPROTONOSUPPORT);
#endif #endif
#ifdef ESOCKTNOSUPPORT #ifdef WSAECONNRESET
/* Socket type not supported */ inscode(d, ds, de, "WSAECONNRESET", WSAECONNRESET, "Connection reset by peer");
insint(d, "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT);
#endif #endif
#ifdef EOPNOTSUPP #ifdef WSAGETSELECTERRO
/* Operation not supported on transport endpoint */ inscode(d, ds, de, "WSAGETSELECTERRO", WSAGETSELECTERRO, "Error WSAGETSELECTERRO");
insint(d, "EOPNOTSUPP", EOPNOTSUPP);
#endif #endif
#ifdef EPFNOSUPPORT #ifdef WSAETIMEDOUT
/* Protocol family not supported */ inscode(d, ds, de, "WSAETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
insint(d, "EPFNOSUPPORT", EPFNOSUPPORT);
#endif #endif
#ifdef EAFNOSUPPORT #ifdef WSAENOBUFS
/* Address family not supported by protocol */ inscode(d, ds, de, "WSAENOBUFS", WSAENOBUFS, "No buffer space available");
insint(d, "EAFNOSUPPORT", EAFNOSUPPORT);
#endif #endif
#ifdef EADDRINUSE #ifdef WSAEDISCON
/* Address already in use */ inscode(d, ds, de, "WSAEDISCON", WSAEDISCON, "Error WSAEDISCON");
insint(d, "EADDRINUSE", EADDRINUSE);
#endif #endif
#ifdef EADDRNOTAVAIL #ifdef WSAEINTR
/* Cannot assign requested address */ inscode(d, ds, de, "WSAEINTR", WSAEINTR, "Interrupted system call");
insint(d, "EADDRNOTAVAIL", EADDRNOTAVAIL);
#endif #endif
#ifdef ENETDOWN #ifdef WSAEPROTOTYPE
/* Network is down */ inscode(d, ds, de, "WSAEPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
insint(d, "ENETDOWN", ENETDOWN);
#endif #endif
#ifdef ENETUNREACH #ifdef WSAHOS
/* Network is unreachable */ inscode(d, ds, de, "WSAHOS", WSAHOS, "Error WSAHOS");
insint(d, "ENETUNREACH", ENETUNREACH);
#endif #endif
#ifdef ENETRESET #ifdef WSAEADDRINUSE
/* Network dropped connection because of reset */ inscode(d, ds, de, "WSAEADDRINUSE", WSAEADDRINUSE, "Address already in use");
insint(d, "ENETRESET", ENETRESET);
#endif #endif
#ifdef ECONNABORTED #ifdef WSAEADDRNOTAVAIL
/* Software caused connection abort */ inscode(d, ds, de, "WSAEADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
insint(d, "ECONNABORTED", ECONNABORTED);
#endif #endif
#ifdef ECONNRESET #ifdef WSAEALREADY
/* Connection reset by peer */ inscode(d, ds, de, "WSAEALREADY", WSAEALREADY, "Operation already in progress");
insint(d, "ECONNRESET", ECONNRESET);
#endif #endif
#ifdef ENOBUFS #ifdef WSAEPROTONOSUPPORT
/* No buffer space available */ inscode(d, ds, de, "WSAEPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
insint(d, "ENOBUFS", ENOBUFS);
#endif #endif
#ifdef EISCONN #ifdef WSASYSNOTREADY
/* Transport endpoint is already connected */ inscode(d, ds, de, "WSASYSNOTREADY", WSASYSNOTREADY, "Error WSASYSNOTREADY");
insint(d, "EISCONN", EISCONN);
#endif #endif
#ifdef ENOTCONN #ifdef WSAEWOULDBLOCK
/* Transport endpoint is not connected */ inscode(d, ds, de, "WSAEWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
insint(d, "ENOTCONN", ENOTCONN);
#endif #endif
#ifdef ESHUTDOWN #ifdef WSAEPFNOSUPPORT
/* Cannot send after transport endpoint shutdown */ inscode(d, ds, de, "WSAEPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
insint(d, "ESHUTDOWN", ESHUTDOWN);
#endif #endif
#ifdef ETOOMANYREFS #ifdef WSAEOPNOTSUPP
/* Too many references: cannot splice */ inscode(d, ds, de, "WSAEOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
insint(d, "ETOOMANYREFS", ETOOMANYREFS);
#endif #endif
#ifdef ETIMEDOUT #ifdef WSAEISCONN
/* Connection timed out */ inscode(d, ds, de, "WSAEISCONN", WSAEISCONN, "Transport endpoint is already connected");
insint(d, "ETIMEDOUT", ETIMEDOUT);
#endif #endif
#ifdef ECONNREFUSED #ifdef WSAEDQUOT
/* Connection refused */ inscode(d, ds, de, "WSAEDQUOT", WSAEDQUOT, "Quota exceeded");
insint(d, "ECONNREFUSED", ECONNREFUSED);
#endif #endif
#ifdef EHOSTDOWN #ifdef WSAENOTCONN
/* Host is down */ inscode(d, ds, de, "WSAENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
insint(d, "EHOSTDOWN", EHOSTDOWN);
#endif #endif
#ifdef EHOSTUNREACH #ifdef WSAEREMOTE
/* No route to host */ inscode(d, ds, de, "WSAEREMOTE", WSAEREMOTE, "Object is remote");
insint(d, "EHOSTUNREACH", EHOSTUNREACH);
#endif #endif
#ifdef EALREADY #ifdef WSAEINVAL
/* Operation already in progress */ inscode(d, ds, de, "WSAEINVAL", WSAEINVAL, "Invalid argument");
insint(d, "EALREADY", EALREADY);
#endif #endif
#ifdef EINPROGRESS #ifdef WSAEINPROGRESS
/* Operation now in progress */ inscode(d, ds, de, "WSAEINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
insint(d, "EINPROGRESS", EINPROGRESS);
#endif #endif
#ifdef ESTALE #ifdef WSAGETSELECTEVEN
/* Stale NFS file handle */ inscode(d, ds, de, "WSAGETSELECTEVEN", WSAGETSELECTEVEN, "Error WSAGETSELECTEVEN");
insint(d, "ESTALE", ESTALE);
#endif #endif
#ifdef EUCLEAN #ifdef WSAESOCKTNOSUPPORT
/* Structure needs cleaning */ inscode(d, ds, de, "WSAESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
insint(d, "EUCLEAN", EUCLEAN);
#endif #endif
#ifdef ENOTNAM #ifdef WSAGETASYNCERRO
/* Not a XENIX named type file */ inscode(d, ds, de, "WSAGETASYNCERRO", WSAGETASYNCERRO, "Error WSAGETASYNCERRO");
insint(d, "ENOTNAM", ENOTNAM);
#endif #endif
#ifdef ENAVAIL #ifdef WSAMAKESELECTREPL
/* No XENIX semaphores available */ inscode(d, ds, de, "WSAMAKESELECTREPL", WSAMAKESELECTREPL, "Error WSAMAKESELECTREPL");
insint(d, "ENAVAIL", ENAVAIL);
#endif #endif
#ifdef EISNAM #ifdef WSAGETASYNCBUFLE
/* Is a named type file */ inscode(d, ds, de, "WSAGETASYNCBUFLE", WSAGETASYNCBUFLE, "Error WSAGETASYNCBUFLE");
insint(d, "EISNAM", EISNAM);
#endif #endif
#ifdef EREMOTEIO #ifdef WSAEDESTADDRREQ
/* Remote I/O error */ inscode(d, ds, de, "WSAEDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
insint(d, "EREMOTEIO", EREMOTEIO);
#endif #endif
#ifdef EDQUOT #ifdef WSAECONNREFUSED
/* Quota exceeded */ inscode(d, ds, de, "WSAECONNREFUSED", WSAECONNREFUSED, "Connection refused");
insint(d, "EDQUOT", EDQUOT); #endif
#ifdef WSAENETRESET
inscode(d, ds, de, "WSAENETRESET", WSAENETRESET, "Network dropped connection because of reset");
#endif #endif
#ifdef WSAN
inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
#endif
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment