diff options
Diffstat (limited to 'generic/tclPosixStr.c')
| -rw-r--r-- | generic/tclPosixStr.c | 231 |
1 files changed, 69 insertions, 162 deletions
diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c index 52d5f09..a11b532 100644 --- a/generic/tclPosixStr.c +++ b/generic/tclPosixStr.c @@ -4,8 +4,8 @@ * This file contains procedures that generate strings corresponding to * various POSIX-related codes, such as errno and signals. * - * Copyright © 1991-1994 The Regents of the University of California. - * Copyright © 1994-1996 Sun Microsystems, Inc. + * Copyright (c) 1991-1994 The Regents of the University of California. + * Copyright (c) 1994-1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -31,7 +31,7 @@ *---------------------------------------------------------------------- */ -const char * +CONST char * Tcl_ErrnoId(void) { switch (errno) { @@ -62,9 +62,6 @@ Tcl_ErrnoId(void) #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY)) case EALREADY: return "EALREADY"; #endif -#ifdef EBADCAT - case EBADCAT: return "EBADCAT"; -#endif #ifdef EBADE case EBADE: return "EBADE"; #endif @@ -95,12 +92,6 @@ Tcl_ErrnoId(void) #ifdef EBUSY case EBUSY: return "EBUSY"; #endif -#ifdef ECANCELED - case ECANCELED: return "ECANCELED"; -#endif -#ifdef ECASECLASH - case ECASECLASH: return "ECASECLASH"; -#endif #ifdef ECHILD case ECHILD: return "ECHILD"; #endif @@ -146,18 +137,12 @@ Tcl_ErrnoId(void) #ifdef EEXIST case EEXIST: return "EEXIST"; #endif -#ifdef EFAIL - case EFAIL: return "EFAIL"; -#endif #ifdef EFAULT case EFAULT: return "EFAULT"; #endif #ifdef EFBIG case EFBIG: return "EFBIG"; #endif -#ifdef EFTYPE - case EFTYPE: return "EFTYPE"; -#endif #ifdef EHOSTDOWN case EHOSTDOWN: return "EHOSTDOWN"; #endif @@ -170,12 +155,6 @@ Tcl_ErrnoId(void) #ifdef EINIT case EINIT: return "EINIT"; #endif -#ifdef EILSEQ - case EILSEQ: return "EILSEQ"; -#endif -#ifdef EINPROG - case EINPROG: return "EINPROG"; -#endif #ifdef EINPROGRESS case EINPROGRESS: return "EINPROGRESS"; #endif @@ -194,9 +173,12 @@ Tcl_ErrnoId(void) #ifdef EISDIR case EISDIR: return "EISDIR"; #endif -#ifdef EISNAM +#ifdef EISNAME case EISNAM: return "EISNAM"; #endif +#ifdef ELBIN + case ELBIN: return "ELBIN"; +#endif #ifdef EL2HLT case EL2HLT: return "EL2HLT"; #endif @@ -209,9 +191,6 @@ Tcl_ErrnoId(void) #ifdef EL3RST case EL3RST: return "EL3RST"; #endif -#ifdef ELBIN - case ELBIN: return "ELBIN"; -#endif #ifdef ELIBACC case ELIBACC: return "ELIBACC"; #endif @@ -221,7 +200,7 @@ Tcl_ErrnoId(void) #ifdef ELIBEXEC case ELIBEXEC: return "ELIBEXEC"; #endif -#if defined(ELIBMAX) && (!defined(ECANCELED) || (ELIBMAX != ECANCELED)) +#ifdef ELIBMAX case ELIBMAX: return "ELIBMAX"; #endif #ifdef ELIBSCN @@ -233,9 +212,6 @@ Tcl_ErrnoId(void) #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) case ELOOP: return "ELOOP"; #endif -#ifdef EMEDIUMTYPE - case EMEDIUMTYPE: return "EMEDIUMTYPE"; -#endif #ifdef EMFILE case EMFILE: return "EMFILE"; #endif @@ -254,6 +230,9 @@ Tcl_ErrnoId(void) #ifdef ENAVAIL case ENAVAIL: return "ENAVAIL"; #endif +#ifdef ENET + case ENET: return "ENET"; +#endif #ifdef ENETDOWN case ENETDOWN: return "ENETDOWN"; #endif @@ -266,9 +245,6 @@ Tcl_ErrnoId(void) #ifdef ENFILE case ENFILE: return "ENFILE"; #endif -#ifdef ENMFILE - case ENMFILE: return "ENMFILE"; -#endif #ifdef ENOANO case ENOANO: return "ENOANO"; #endif @@ -293,15 +269,12 @@ Tcl_ErrnoId(void) #ifdef ENOLCK case ENOLCK: return "ENOLCK"; #endif -#ifdef ENOLINK +#if defined(ENOLINK) && (!defined(ESOCKTNOSUPPORT) || (ESOCKTNOSUPPORT != ENOLINK)) case ENOLINK: return "ENOLINK"; #endif #ifdef ENOMEM case ENOMEM: return "ENOMEM"; #endif -#ifdef ENOMEDIUM - case ENOMEDIUM: return "ENOMEDIUM"; -#endif #ifdef ENOMSG case ENOMSG: return "ENOMSG"; #endif @@ -311,12 +284,9 @@ Tcl_ErrnoId(void) #ifdef ENOPKG case ENOPKG: return "ENOPKG"; #endif -#ifdef ENOPROTOOPT +#if defined(ENOPROTOOPT) && (!defined(EPFNOSUPPORT) || (EPFNOSUPPORT != ENOPROTOOPT)) case ENOPROTOOPT: return "ENOPROTOOPT"; #endif -#ifdef ENOSHARE - case ENOSHARE: return "ENOSHARE"; -#endif #ifdef ENOSPC case ENOSPC: return "ENOSPC"; #endif @@ -338,9 +308,6 @@ Tcl_ErrnoId(void) #ifdef ENOTCONN case ENOTCONN: return "ENOTCONN"; #endif -#ifdef ENOTRECOVERABLE - case ENOTRECOVERABLE: return "ENOTRECOVERABLE"; -#endif #ifdef ENOTDIR case ENOTDIR: return "ENOTDIR"; #endif @@ -362,24 +329,15 @@ Tcl_ErrnoId(void) #ifdef ENOTUNIQ case ENOTUNIQ: return "ENOTUNIQ"; #endif -#ifdef ENWAIT - case ENWAIT: return "ENWAIT"; -#endif #ifdef ENXIO case ENXIO: return "ENXIO"; #endif #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP)) case EOPNOTSUPP: return "EOPNOTSUPP"; #endif -#ifdef EOTHER - case EOTHER: return "EOTHER"; -#endif #if defined(EOVERFLOW) && (!defined(EFBIG) || (EOVERFLOW != EFBIG)) && (!defined(EINVAL) || (EOVERFLOW != EINVAL)) case EOVERFLOW: return "EOVERFLOW"; #endif -#ifdef EOWNERDEAD - case EOWNERDEAD: return "EOWNERDEAD"; -#endif #ifdef EPERM case EPERM: return "EPERM"; #endif @@ -431,9 +389,6 @@ Tcl_ErrnoId(void) #ifdef EREMOTERELEASE case EREMOTERELEASE: return "EREMOTERELEASE"; #endif -#ifdef ERESTART - case ERESTART: return "ERESTART"; -#endif #ifdef EROFS case EROFS: return "EROFS"; #endif @@ -522,7 +477,7 @@ Tcl_ErrnoId(void) *---------------------------------------------------------------------- */ -const char * +CONST char * Tcl_ErrnoMsg( int err) /* Error number (such as in errno variable). */ { @@ -537,46 +492,43 @@ Tcl_ErrnoMsg( case EADDRINUSE: return "address already in use"; #endif #ifdef EADDRNOTAVAIL - case EADDRNOTAVAIL: return "cannot assign requested address"; + case EADDRNOTAVAIL: return "can't assign requested address"; #endif #ifdef EADV case EADV: return "advertise error"; #endif #ifdef EAFNOSUPPORT - case EAFNOSUPPORT: return "address family not supported by protocol"; + case EAFNOSUPPORT: return "address family not supported by protocol family"; #endif #ifdef EAGAIN case EAGAIN: return "resource temporarily unavailable"; #endif #ifdef EALIGN - case EALIGN: return "alignment error"; + case EALIGN: return "EALIGN"; #endif #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY)) case EALREADY: return "operation already in progress"; #endif -#ifdef EBADCAT - case EBADCAT: return "bad message catalogue format"; -#endif #ifdef EBADE - case EBADE: return "invalid exchange"; + case EBADE: return "bad exchange descriptor"; #endif #ifdef EBADF - case EBADF: return "bad file descriptor"; + case EBADF: return "bad file number"; #endif #ifdef EBADFD case EBADFD: return "file descriptor in bad state"; #endif #ifdef EBADMSG - case EBADMSG: return "bad message"; + case EBADMSG: return "not a data message"; #endif #ifdef EBADR - case EBADR: return "invalid request descriptor"; + case EBADR: return "bad request descriptor"; #endif #ifdef EBADRPC case EBADRPC: return "RPC structure is bad"; #endif #ifdef EBADRQC - case EBADRQC: return "invalid request code"; + case EBADRQC: return "bad request code"; #endif #ifdef EBADSLT case EBADSLT: return "invalid slot"; @@ -585,16 +537,10 @@ Tcl_ErrnoMsg( case EBFONT: return "bad font file format"; #endif #ifdef EBUSY - case EBUSY: return "device or resource busy"; -#endif -#ifdef ECANCELED - case ECANCELED: return "operation canceled"; -#endif -#ifdef ECASECLASH - case ECASECLASH: return "filename exists with different case"; + case EBUSY: return "file busy"; #endif #ifdef ECHILD - case ECHILD: return "no child processes"; + case ECHILD: return "no children"; #endif #ifdef ECHRNG case ECHRNG: return "channel number out of range"; @@ -624,7 +570,7 @@ Tcl_ErrnoMsg( case EDIRTY: return "mounting a dirty fs w/o force"; #endif #ifdef EDOM - case EDOM: return "numerical argument out of domain"; + case EDOM: return "math argument out of range"; #endif #ifdef EDOTDOT case EDOTDOT: return "cross mount point"; @@ -636,25 +582,19 @@ Tcl_ErrnoMsg( case EDUPPKG: return "duplicate package name"; #endif #ifdef EEXIST - case EEXIST: return "file exists"; -#endif -#ifdef EFAIL - case EFAIL: return "cannot start operation"; + case EEXIST: return "file already exists"; #endif #ifdef EFAULT - case EFAULT: return "bad address"; + case EFAULT: return "bad address in system call argument"; #endif #ifdef EFBIG case EFBIG: return "file too large"; #endif -#ifdef EFTYPE - case EFTYPE: return "inappropriate file type or format"; -#endif #ifdef EHOSTDOWN case EHOSTDOWN: return "host is down"; #endif #ifdef EHOSTUNREACH - case EHOSTUNREACH: return "no route to host"; + case EHOSTUNREACH: return "host is unreachable"; #endif #if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS)) case EIDRM: return "identifier removed"; @@ -662,12 +602,6 @@ Tcl_ErrnoMsg( #ifdef EINIT case EINIT: return "initialization error"; #endif -#ifdef EILSEQ - case EILSEQ: return "invalid or incomplete multibyte or wide character"; -#endif -#ifdef EINPROG - case EINPROG: return "asynchronous operation in progress"; -#endif #ifdef EINPROGRESS case EINPROGRESS: return "operation now in progress"; #endif @@ -678,16 +612,19 @@ Tcl_ErrnoMsg( case EINVAL: return "invalid argument"; #endif #ifdef EIO - case EIO: return "input/output error"; + case EIO: return "I/O error"; #endif #ifdef EISCONN - case EISCONN: return "transport endpoint is already connected"; + case EISCONN: return "socket is already connected"; #endif #ifdef EISDIR - case EISDIR: return "is a directory"; + case EISDIR: return "illegal operation on a directory"; #endif -#ifdef EISNAM - case EISNAM: return "is a named type file"; +#ifdef EISNAME + case EISNAM: return "is a name file"; +#endif +#ifdef ELBIN + case ELBIN: return "ELBIN"; #endif #ifdef EL2HLT case EL2HLT: return "level 2 halted"; @@ -701,9 +638,6 @@ Tcl_ErrnoMsg( #ifdef EL3RST case EL3RST: return "level 3 reset"; #endif -#ifdef ELBIN - case ELBIN: return "inode is remote"; -#endif #ifdef ELIBACC case ELIBACC: return "can not access a needed shared library"; #endif @@ -711,11 +645,11 @@ Tcl_ErrnoMsg( case ELIBBAD: return "accessing a corrupted shared library"; #endif #ifdef ELIBEXEC - case ELIBEXEC: return "cannot exec a shared library directly"; + case ELIBEXEC: return "can not exec a shared library directly"; #endif -#if defined(ELIBMAX) && (!defined(ECANCELED) || (ELIBMAX != ECANCELED)) +#ifdef ELIBMAX case ELIBMAX: return - "attempting to link in too many shared libraries"; + "attempting to link in more shared libraries than system limit"; #endif #ifdef ELIBSCN case ELIBSCN: return ".lib section in a.out corrupted"; @@ -726,9 +660,6 @@ Tcl_ErrnoMsg( #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) case ELOOP: return "too many levels of symbolic links"; #endif -#ifdef EMEDIUMTYPE - case EMEDIUMTYPE: return "wrong medium type"; -#endif #ifdef EMFILE case EMFILE: return "too many open files"; #endif @@ -747,6 +678,9 @@ Tcl_ErrnoMsg( #ifdef ENAVAIL case ENAVAIL: return "not available"; #endif +#ifdef ENET + case ENET: return "ENET"; +#endif #ifdef ENETDOWN case ENETDOWN: return "network is down"; #endif @@ -757,13 +691,10 @@ Tcl_ErrnoMsg( case ENETUNREACH: return "network is unreachable"; #endif #ifdef ENFILE - case ENFILE: return "too many open files in system"; -#endif -#ifdef ENMFILE - case ENMFILE: return "no more files"; + case ENFILE: return "file table overflow"; #endif #ifdef ENOANO - case ENOANO: return "no anode"; + case ENOANO: return "anode table overflow"; #endif #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR)) case ENOBUFS: return "no buffer space available"; @@ -786,14 +717,11 @@ Tcl_ErrnoMsg( #ifdef ENOLCK case ENOLCK: return "no locks available"; #endif -#ifdef ENOLINK +#if defined(ENOLINK) && (!defined(ESOCKTNOSUPPORT) || (ESOCKTNOSUPPORT != ENOLINK)) case ENOLINK: return "link has been severed"; #endif #ifdef ENOMEM - case ENOMEM: return "cannot allocate memory"; -#endif -#ifdef ENOMEDIUM - case ENOMEDIUM: return "no medium found"; + case ENOMEM: return "not enough memory"; #endif #ifdef ENOMSG case ENOMSG: return "no message of desired type"; @@ -804,20 +732,17 @@ Tcl_ErrnoMsg( #ifdef ENOPKG case ENOPKG: return "package not installed"; #endif -#ifdef ENOPROTOOPT - case ENOPROTOOPT: return "protocol not available"; -#endif -#ifdef ENOSHARE - case ENOSHARE: return "no such host or network path"; +#if defined(ENOPROTOOPT) && (!defined(EPFNOSUPPORT) || (EPFNOSUPPORT != ENOPROTOOPT)) + case ENOPROTOOPT: return "bad protocol option"; #endif #ifdef ENOSPC case ENOSPC: return "no space left on device"; #endif #if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR)) - case ENOSR: return "out of streams resources"; + case ENOSR: return "out of stream resources"; #endif #if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR)) - case ENOSTR: return "device not a stream"; + case ENOSTR: return "not a stream device"; #endif #ifdef ENOSYM case ENOSYM: return "unresolved symbol name"; @@ -829,7 +754,7 @@ Tcl_ErrnoMsg( case ENOTBLK: return "block device required"; #endif #ifdef ENOTCONN - case ENOTCONN: return "transport endpoint is not connected"; + case ENOTCONN: return "socket is not connected"; #endif #ifdef ENOTDIR case ENOTDIR: return "not a directory"; @@ -840,9 +765,6 @@ Tcl_ErrnoMsg( #ifdef ENOTNAM case ENOTNAM: return "not a name file"; #endif -#ifdef ENOTRECOVERABLE - case ENOTRECOVERABLE: return "state not recoverable"; -#endif #ifdef ENOTSOCK case ENOTSOCK: return "socket operation on non-socket"; #endif @@ -850,31 +772,22 @@ Tcl_ErrnoMsg( case ENOTSUP: return "operation not supported"; #endif #ifdef ENOTTY - case ENOTTY: return "inappropriate ioctl for device"; + case ENOTTY: return "inappropriate device for ioctl"; #endif #ifdef ENOTUNIQ case ENOTUNIQ: return "name not unique on network"; #endif -#ifdef ENWAIT - case ENWAIT: return "No waiting processes"; -#endif #ifdef ENXIO case ENXIO: return "no such device or address"; #endif #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP)) case EOPNOTSUPP: return "operation not supported on socket"; #endif -#ifdef EOTHER - case EOTHER: return "other error"; -#endif #if defined(EOVERFLOW) && (!defined(EFBIG) || (EOVERFLOW != EFBIG)) && (!defined(EINVAL) || (EOVERFLOW != EINVAL)) - case EOVERFLOW: return "value too large for defined data type"; -#endif -#ifdef EOWNERDEAD - case EOWNERDEAD: return "owner died"; + case EOVERFLOW: return "file too big"; #endif #ifdef EPERM - case EPERM: return "operation not permitted"; + case EPERM: return "not owner"; #endif #if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT)) case EPFNOSUPPORT: return "protocol family not supported"; @@ -904,10 +817,10 @@ Tcl_ErrnoMsg( case EPROTOTYPE: return "protocol wrong type for socket"; #endif #ifdef ERANGE - case ERANGE: return "numerical result out of range"; + case ERANGE: return "math result unrepresentable"; #endif #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED)) - case EREFUSED: return "connection refused"; + case EREFUSED: return "EREFUSED"; #endif #ifdef EREMCHG case EREMCHG: return "remote address changed"; @@ -916,16 +829,13 @@ Tcl_ErrnoMsg( case EREMDEV: return "remote device"; #endif #ifdef EREMOTE - case EREMOTE: return "object is remote"; + case EREMOTE: return "pathname hit remote file system"; #endif #ifdef EREMOTEIO - case EREMOTEIO: return "remote I/O error"; + case EREMOTEIO: return "remote i/o error"; #endif #ifdef EREMOTERELEASE - case EREMOTERELEASE: return "remote peer released connection"; -#endif -#ifdef ERESTART - case ERESTART: return "interrupted system call should be restarted"; + case EREMOTERELEASE: return "EREMOTERELEASE"; #endif #ifdef EROFS case EROFS: return "read-only file system"; @@ -937,13 +847,13 @@ Tcl_ErrnoMsg( case ERREMOTE: return "object is remote"; #endif #ifdef ESHUTDOWN - case ESHUTDOWN: return "cannot send after transport endpoint shutdown"; + case ESHUTDOWN: return "can't send after socket shutdown"; #endif #ifdef ESOCKTNOSUPPORT case ESOCKTNOSUPPORT: return "socket type not supported"; #endif #ifdef ESPIPE - case ESPIPE: return "illegal seek"; + case ESPIPE: return "invalid seek"; #endif #ifdef ESRCH case ESRCH: return "no such process"; @@ -952,13 +862,10 @@ Tcl_ErrnoMsg( case ESRMNT: return "srmount error"; #endif #ifdef ESTALE - case ESTALE: return "stale file handle"; -#endif -#ifdef ESTRPIPE - case ESTRPIPE: return "streams pipe error"; + case ESTALE: return "stale remote file handle"; #endif #ifdef ESUCCESS - case ESUCCESS: return "success"; + case ESUCCESS: return "Error 0"; #endif #if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP)) case ETIME: return "timer expired"; @@ -967,10 +874,10 @@ Tcl_ErrnoMsg( case ETIMEDOUT: return "connection timed out"; #endif #ifdef ETOOMANYREFS - case ETOOMANYREFS: return "too many references: cannot splice"; + case ETOOMANYREFS: return "too many references: can't splice"; #endif #ifdef ETXTBSY - case ETXTBSY: return "text file busy"; + case ETXTBSY: return "text file or pseudo-device busy"; #endif #ifdef EUCLEAN case EUCLEAN: return "structure needs cleaning"; @@ -988,10 +895,10 @@ Tcl_ErrnoMsg( case EWOULDBLOCK: return "operation would block"; #endif #ifdef EXDEV - case EXDEV: return "invalid cross-device link"; + case EXDEV: return "cross-domain link"; #endif #ifdef EXFULL - case EXFULL: return "exchange full"; + case EXFULL: return "message tables full"; #endif default: #ifdef NO_STRERROR @@ -1020,7 +927,7 @@ Tcl_ErrnoMsg( *---------------------------------------------------------------------- */ -const char * +CONST char * Tcl_SignalId( int sig) /* Number of signal. */ { @@ -1154,7 +1061,7 @@ Tcl_SignalId( *---------------------------------------------------------------------- */ -const char * +CONST char * Tcl_SignalMsg( int sig) /* Number of signal. */ { |
