tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH 4/7] PR standards/44921: Add errno consts for robust mutexes



Add the two missing errno.h constants: EOWNERDEAD and ENOTRECOVERABLE.
While technically they're used for robust mutexes which we do not
support at the moment, they are listed in POSIX and used by libc++.
While libc++ can be made to build without it, it just locally redefines
the values then, so we may as well define them globally.
---
 lib/libc/nls/C.msg                    | 4 ++++
 lib/libc/sys/intro.2                  | 5 +++++
 sys/compat/linux/common/linux_errno.c | 2 ++
 sys/sys/errno.h                       | 6 +++++-
 tests/include/t_errno.c               | 1 -
 5 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/lib/libc/nls/C.msg b/lib/libc/nls/C.msg
index d5000dc00aec..acdd50cd94ed 100644
--- a/lib/libc/nls/C.msg
+++ b/lib/libc/nls/C.msg
@@ -191,6 +191,10 @@ $ ENOLINK
 95 Link has been severed
 $ EPROTO
 96 Protocol error
+$ EOWNERDEAD
+97 Previous owner died
+$ ENOTRECOVERABLE
+98 State not recoverable
 $set 2
 $ SIGHUP
 1 Hangup
diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2
index f2e6a06cb62d..ad97c6ad9dd9 100644
--- a/lib/libc/sys/intro.2
+++ b/lib/libc/sys/intro.2
@@ -505,6 +505,11 @@ Occurs when the link (virtual circuit) connecting to a remote machine is gone.
 Some protocol error occurred.
 This error is device-specific, but is generally not related to a hardware
 failure.
+.It Er 97 EOWNERDEAD Em "Previous owner died" .
+Occurs when the last owner of a robust mutex dies while holding the mutex.
+.It Er 98 ENOTRECOVERABLE Em "State not recoverable" .
+Occurs when the last owner of a robust mutex died and the new owner
+had unlocked the mutex without making its state consistent.
 .El
 .Sh DEFINITIONS
 .Bl -tag -width Ds
diff --git a/sys/compat/linux/common/linux_errno.c b/sys/compat/linux/common/linux_errno.c
index 7ec5ae256c02..530c5e474de2 100644
--- a/sys/compat/linux/common/linux_errno.c
+++ b/sys/compat/linux/common/linux_errno.c
@@ -138,5 +138,7 @@ const int native_to_linux_errno[] = {
 	LINUX_SCERR_SIGN LINUX_EMULTIHOP,
 	LINUX_SCERR_SIGN LINUX_ENOLINK,
 	LINUX_SCERR_SIGN LINUX_EPROTO,		/* 96 */
+	LINUX_SCERR_SIGN LINUX_EOWNERDEAD,
+	LINUX_SCERR_SIGN LINUX_ENOTRECOVERABLE,
 };
 __CTASSERT(__arraycount(native_to_linux_errno) == ELAST + 1);
diff --git a/sys/sys/errno.h b/sys/sys/errno.h
index c93397db1828..c9a9e70f4f61 100644
--- a/sys/sys/errno.h
+++ b/sys/sys/errno.h
@@ -172,7 +172,11 @@
 #define	ENOLINK		95		/* Link has been severed */
 #define	EPROTO		96		/* Protocol error */
 
-#define	ELAST		96		/* Must equal largest errno */
+/* Robust mutexes */
+#define	EOWNERDEAD	97		/* Previous owner died */
+#define	ENOTRECOVERABLE	98		/* State not recoverable */
+
+#define	ELAST		98		/* Must equal largest errno */
 
 #if defined(_KERNEL) || defined(_KMEMUSER)
 /* pseudo-errors returned inside kernel to modify return to process */
diff --git a/tests/include/t_errno.c b/tests/include/t_errno.c
index 763e5697aadf..dafc96967a56 100644
--- a/tests/include/t_errno.c
+++ b/tests/include/t_errno.c
@@ -48,7 +48,6 @@ ATF_TC_BODY(errno_constants, tc)
 	 * The following definitions should be available
 	 * according to IEEE Std 1003.1-2008, issue 7.
 	 */
-	atf_tc_expect_fail("PR standards/44921");
 
 	fail = true;
 
-- 
2.25.1



Home | Main Index | Thread Index | Old Index