From 29212ab3cdaf3ffe6dd03ec619a23018c179263b Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 19 Sep 2008 16:11:35 +0000 Subject: [PATCH] 2008-09-19 Eric Blake Supply missing POSIX errno values. * libc/include/sys/errno.h (ENOTRECOVERABLE, EOWNERDEAD): Define. * libc/string/strerror.c (strerror): Decode them, and ECANCELED. --- newlib/ChangeLog | 6 ++++++ newlib/libc/include/sys/errno.h | 5 ++++- newlib/libc/string/strerror.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1a1ca460d..4440a7183 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2008-09-19 Eric Blake + + Supply missing POSIX errno values. + * libc/include/sys/errno.h (ENOTRECOVERABLE, EOWNERDEAD): Define. + * libc/string/strerror.c (strerror): Decode them, and ECANCELED. + 2008-09-10 Ken Werner * libc/machine/spu/strcpy.h: Add missing header. diff --git a/newlib/libc/include/sys/errno.h b/newlib/libc/include/sys/errno.h index 1721ef4c8..f130e3ebd 100644 --- a/newlib/libc/include/sys/errno.h +++ b/newlib/libc/include/sys/errno.h @@ -148,7 +148,10 @@ extern __IMPORT int sys_nerr; #define ECASECLASH 137 /* Filename exists with different case */ #define EILSEQ 138 #define EOVERFLOW 139 /* Value too large for defined data type */ -#define ECANCELED 140 /* Operation canceled. */ +#define ECANCELED 140 /* Operation canceled */ +#define ENOTRECOVERABLE 141 /* State not recoverable */ +#define EOWNERDEAD 142 /* Previous owner died */ + /* From cygwin32. */ #define EWOULDBLOCK EAGAIN /* Operation would block */ diff --git a/newlib/libc/string/strerror.c b/newlib/libc/string/strerror.c index 8bea4b768..73660f076 100644 --- a/newlib/libc/string/strerror.c +++ b/newlib/libc/string/strerror.c @@ -274,6 +274,15 @@ Text file busy o EXDEV Cross-device link +o ECANCELED +Operation canceled + +o ENOTRECOVERABLE +State not recoverable + +o EOWNERDEAD +Previous owner died + o- RETURNS @@ -436,7 +445,7 @@ _DEFUN (strerror, (errnum), error = "Host is down"; break; #endif -#ifdef EINPROGRESS +#ifdef EINPROGRESS case EINPROGRESS: error = "Connection already in progress"; break; @@ -541,7 +550,7 @@ _DEFUN (strerror, (errnum), error = "Deadlock"; break; #endif -#ifdef ENETUNREACH +#ifdef ENETUNREACH case ENETUNREACH: error = "Network is unreachable"; break; @@ -736,6 +745,21 @@ _DEFUN (strerror, (errnum), error = "Socket is already connected"; break; #endif +#ifdef ECANCELED + case ECANCELED: + error = "Operation canceled"; + break; +#endif +#ifdef ENOTRECOVERABLE + case ENOTRECOVERABLE: + error = "State not recoverable"; + break; +#endif +#ifdef EOWNERDEAD + case EOWNERDEAD: + error = "Previous owner died"; + break; +#endif #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP)) case EOPNOTSUPP: error = "Operation not supported on socket";