summaryrefslogtreecommitdiffstats
path: root/generic/tclPosixStr.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclPosixStr.c')
-rw-r--r--generic/tclPosixStr.c80
1 files changed, 54 insertions, 26 deletions
diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c
index a48c2dd..411eb27 100644
--- a/generic/tclPosixStr.c
+++ b/generic/tclPosixStr.c
@@ -9,8 +9,6 @@
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tclPosixStr.c,v 1.12 2005/11/07 15:16:03 dkf Exp $
*/
#include "tclInt.h"
@@ -33,11 +31,11 @@
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tcl_ErrnoId(void)
{
switch (errno) {
-#ifdef E2BIG
+#if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW))
case E2BIG: return "E2BIG";
#endif
#ifdef EACCES
@@ -61,7 +59,7 @@ Tcl_ErrnoId(void)
#ifdef EALIGN
case EALIGN: return "EALIGN";
#endif
-#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY ))
+#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY))
case EALREADY: return "EALREADY";
#endif
#ifdef EBADE
@@ -76,6 +74,9 @@ Tcl_ErrnoId(void)
#ifdef EBADMSG
case EBADMSG: return "EBADMSG";
#endif
+#ifdef ECANCELED
+ case ECANCELED: return "ECANCELED";
+#endif
#ifdef EBADR
case EBADR: return "EBADR";
#endif
@@ -202,7 +203,7 @@ Tcl_ErrnoId(void)
#ifdef ELIBEXEC
case ELIBEXEC: return "ELIBEXEC";
#endif
-#ifdef ELIBMAX
+#if defined(ELIBMAX) && (!defined(ECANCELED) || (ELIBMAX != ECANCELED))
case ELIBMAX: return "ELIBMAX";
#endif
#ifdef ELIBSCN
@@ -310,6 +311,9 @@ Tcl_ErrnoId(void)
#ifdef ENOTCONN
case ENOTCONN: return "ENOTCONN";
#endif
+#ifdef ENOTRECOVERABLE
+ case ENOTRECOVERABLE: return "ENOTRECOVERABLE";
+#endif
#ifdef ENOTDIR
case ENOTDIR: return "ENOTDIR";
#endif
@@ -337,9 +341,15 @@ Tcl_ErrnoId(void)
#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
case EOPNOTSUPP: return "EOPNOTSUPP";
#endif
-#if defined(EOVERFLOW) && ( !defined(EFBIG) || (EOVERFLOW != EFBIG) ) && ( !defined(EINVAL) || (EOVERFLOW != EINVAL) )
+#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
@@ -479,12 +489,12 @@ Tcl_ErrnoId(void)
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tcl_ErrnoMsg(
int err) /* Error number (such as in errno variable). */
{
switch (err) {
-#ifdef E2BIG
+#if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW))
case E2BIG: return "argument list too long";
#endif
#ifdef EACCES
@@ -494,13 +504,13 @@ Tcl_ErrnoMsg(
case EADDRINUSE: return "address already in use";
#endif
#ifdef EADDRNOTAVAIL
- case EADDRNOTAVAIL: return "can't assign requested address";
+ case EADDRNOTAVAIL: return "cannot assign requested address";
#endif
#ifdef EADV
case EADV: return "advertise error";
#endif
#ifdef EAFNOSUPPORT
- case EAFNOSUPPORT: return "address family not supported by protocol family";
+ case EAFNOSUPPORT: return "address family not supported by protocol";
#endif
#ifdef EAGAIN
case EAGAIN: return "resource temporarily unavailable";
@@ -508,7 +518,7 @@ Tcl_ErrnoMsg(
#ifdef EALIGN
case EALIGN: return "EALIGN";
#endif
-#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY ))
+#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY))
case EALREADY: return "operation already in progress";
#endif
#ifdef EBADE
@@ -523,6 +533,9 @@ Tcl_ErrnoMsg(
#ifdef EBADMSG
case EBADMSG: return "not a data message";
#endif
+#ifdef ECANCELED
+ case ECANCELED: return "operation canceled";
+#endif
#ifdef EBADR
case EBADR: return "bad request descriptor";
#endif
@@ -641,17 +654,17 @@ Tcl_ErrnoMsg(
case EL3RST: return "level 3 reset";
#endif
#ifdef ELIBACC
- case ELIBACC: return "can not access a needed shared library";
+ case ELIBACC: return "cannot access a needed shared library";
#endif
#ifdef ELIBBAD
case ELIBBAD: return "accessing a corrupted shared library";
#endif
#ifdef ELIBEXEC
- case ELIBEXEC: return "can not exec a shared library directly";
+ case ELIBEXEC: return "cannot exec a shared library directly";
#endif
-#ifdef ELIBMAX
+#if defined(ELIBMAX) && (!defined(ECANCELED) || (ELIBMAX != ECANCELED))
case ELIBMAX: return
- "attempting to link in more shared libraries than system limit";
+ "attempting to link in more shared libraries than system limit";
#endif
#ifdef ELIBSCN
case ELIBSCN: return ".lib section in a.out corrupted";
@@ -720,7 +733,7 @@ Tcl_ErrnoMsg(
case ENOLCK: return "no locks available";
#endif
#ifdef ENOLINK
- case ENOLINK: return "link has be severed";
+ case ENOLINK: return "link has been severed";
#endif
#ifdef ENOMEM
case ENOMEM: return "not enough memory";
@@ -758,6 +771,9 @@ Tcl_ErrnoMsg(
#ifdef ENOTCONN
case ENOTCONN: return "socket is not connected";
#endif
+#ifdef ENOTRECOVERABLE
+ case ENOTRECOVERABLE: return "state not recoverable";
+#endif
#ifdef ENOTDIR
case ENOTDIR: return "not a directory";
#endif
@@ -785,9 +801,15 @@ Tcl_ErrnoMsg(
#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
case EOPNOTSUPP: return "operation not supported on socket";
#endif
-#if defined(EOVERFLOW) && ( !defined(EFBIG) || (EOVERFLOW != EFBIG) ) && ( !defined(EINVAL) || (EOVERFLOW != EINVAL) )
+#ifdef EOTHER
+ case EOTHER: return "other error";
+#endif
+#if defined(EOVERFLOW) && (!defined(EFBIG) || (EOVERFLOW != EFBIG)) && (!defined(EINVAL) || (EOVERFLOW != EINVAL))
case EOVERFLOW: return "file too big";
#endif
+#ifdef EOWNERDEAD
+ case EOWNERDEAD: return "owner died";
+#endif
#ifdef EPERM
case EPERM: return "not owner";
#endif
@@ -813,7 +835,7 @@ Tcl_ErrnoMsg(
case EPROTO: return "protocol error";
#endif
#ifdef EPROTONOSUPPORT
- case EPROTONOSUPPORT: return "protocol not suppored";
+ case EPROTONOSUPPORT: return "protocol not supported";
#endif
#ifdef EPROTOTYPE
case EPROTOTYPE: return "protocol wrong type for socket";
@@ -849,7 +871,7 @@ Tcl_ErrnoMsg(
case ERREMOTE: return "object is remote";
#endif
#ifdef ESHUTDOWN
- case ESHUTDOWN: return "can't send afer socket shutdown";
+ case ESHUTDOWN: return "cannot send after socket shutdown";
#endif
#ifdef ESOCKTNOSUPPORT
case ESOCKTNOSUPPORT: return "socket type not supported";
@@ -876,7 +898,7 @@ Tcl_ErrnoMsg(
case ETIMEDOUT: return "connection timed out";
#endif
#ifdef ETOOMANYREFS
- case ETOOMANYREFS: return "too many references: can't splice";
+ case ETOOMANYREFS: return "too many references: cannot splice";
#endif
#ifdef ETXTBSY
case ETXTBSY: return "text file or pseudo-device busy";
@@ -906,7 +928,7 @@ Tcl_ErrnoMsg(
#ifdef NO_STRERROR
return "unknown POSIX error";
#else
- return strerror(errno);
+ return strerror(err);
#endif
}
}
@@ -929,7 +951,7 @@ Tcl_ErrnoMsg(
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tcl_SignalId(
int sig) /* Number of signal. */
{
@@ -994,7 +1016,7 @@ Tcl_SignalId(
#ifdef SIGQUIT
case SIGQUIT: return "SIGQUIT";
#endif
-#ifdef SIGSEGV
+#if defined(SIGSEGV) && (!defined(SIGBUS) || (SIGSEGV != SIGBUS))
case SIGSEGV: return "SIGSEGV";
#endif
#ifdef SIGSTOP
@@ -1039,6 +1061,9 @@ Tcl_SignalId(
#ifdef SIGXFSZ
case SIGXFSZ: return "SIGXFSZ";
#endif
+#if defined(SIGINFO) && (!defined(SIGPWR) || (SIGINFO != SIGPWR))
+ case SIGINFO: return "SIGINFO";
+#endif
}
return "unknown signal";
}
@@ -1060,7 +1085,7 @@ Tcl_SignalId(
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tcl_SignalMsg(
int sig) /* Number of signal. */
{
@@ -1125,7 +1150,7 @@ Tcl_SignalMsg(
#ifdef SIGQUIT
case SIGQUIT: return "quit signal";
#endif
-#ifdef SIGSEGV
+#if defined(SIGSEGV) && (!defined(SIGBUS) || (SIGSEGV != SIGBUS))
case SIGSEGV: return "segmentation violation";
#endif
#ifdef SIGSTOP
@@ -1170,6 +1195,9 @@ Tcl_SignalMsg(
#ifdef SIGXFSZ
case SIGXFSZ: return "exceeded file size limit";
#endif
+#if defined(SIGINFO) && (!defined(SIGPWR) || (SIGINFO != SIGPWR))
+ case SIGINFO: return "information request";
+#endif
}
return "unknown signal";
}