This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

missing errno values


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

POSIX 2001 requires ECANCELED (and while this was added in Feb, strerror
did not pick it up).  And POSIX 200x, due out later this year, adds
ENOTRECOVERABLE and EOWNERDEAD (in the context of robust mutexes).  OK to
commit?  Or should the new values occupy some of the previously reserved
values (for example, 47 and 48)?

Once this is approved, I will post the followup patch to cygwin's
_sys_errlist in their error.cc file (it already has to grow to support
ECANCELED, whether or not the two new macros are injected in the middle to
save size).

2008-09-15  Eric Blake  <ebb9@byu.net>

	Supply missing POSIX errno values.
	* libc/include/sys/errno.h (ENOTRECOVERABLE, EOWNERDEAD): Define.
	* libc/string/strerror.c (strerror): Decode them, and ECANCELED.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjOTgwACgkQ84KuGfSFAYDFMgCgm2mQ1NZb7wIyQ/Ns5hYWTi0S
XV0AoJd2ox0i9njQlV4z9Fqj2Ac8nMvd
=kD4X
-----END PGP SIGNATURE-----
Index: libc/include/sys/errno.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/errno.h,v
retrieving revision 1.12
diff -u -p -r1.12 errno.h
--- libc/include/sys/errno.h	2 Feb 2007 16:22:28 -0000	1.12
+++ libc/include/sys/errno.h	15 Sep 2008 11:52:04 -0000
@@ -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 */
Index: libc/string/strerror.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/strerror.c,v
retrieving revision 1.3
diff -u -p -r1.3 strerror.c
--- libc/string/strerror.c	17 May 2002 23:39:38 -0000	1.3
+++ libc/string/strerror.c	15 Sep 2008 11:52:04 -0000
@@ -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";

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]