Source-Changes-HG archive

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

[src/trunk]: src PR standards/44921: Add errno consts for robust mutexes



details:   https://anonhg.NetBSD.org/src/rev/aca5b8b08613
branches:  trunk
changeset: 745682:aca5b8b08613
user:      mgorny <mgorny%NetBSD.org@localhost>
date:      Sun Mar 08 22:09:42 2020 +0000

description:
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.

diffstat:

 lib/libc/nls/C.msg                    |  4 ++++
 lib/libc/sys/intro.2                  |  7 ++++++-
 sys/compat/linux/common/linux_errno.c |  6 ++++--
 sys/sys/errno.h                       |  8 ++++++--
 tests/include/t_errno.c               |  5 ++---
 5 files changed, 22 insertions(+), 8 deletions(-)

diffs (109 lines):

diff -r 03559c70318b -r aca5b8b08613 lib/libc/nls/C.msg
--- a/lib/libc/nls/C.msg        Sun Mar 08 22:08:46 2020 +0000
+++ b/lib/libc/nls/C.msg        Sun Mar 08 22:09:42 2020 +0000
@@ -191,6 +191,10 @@
 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 -r 03559c70318b -r aca5b8b08613 lib/libc/sys/intro.2
--- a/lib/libc/sys/intro.2      Sun Mar 08 22:08:46 2020 +0000
+++ b/lib/libc/sys/intro.2      Sun Mar 08 22:09:42 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: intro.2,v 1.60 2017/07/03 21:32:50 wiz Exp $
+.\"    $NetBSD: intro.2,v 1.61 2020/03/08 22:09:42 mgorny Exp $
 .\"
 .\" Copyright (c) 1980, 1983, 1986, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -505,6 +505,11 @@
 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 -r 03559c70318b -r aca5b8b08613 sys/compat/linux/common/linux_errno.c
--- a/sys/compat/linux/common/linux_errno.c     Sun Mar 08 22:08:46 2020 +0000
+++ b/sys/compat/linux/common/linux_errno.c     Sun Mar 08 22:09:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_errno.c,v 1.15 2013/12/22 17:14:22 njoly Exp $   */
+/*     $NetBSD: linux_errno.c,v 1.16 2020/03/08 22:09:43 mgorny Exp $  */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_errno.c,v 1.15 2013/12/22 17:14:22 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_errno.c,v 1.16 2020/03/08 22:09:43 mgorny Exp $");
 
 #include <sys/errno.h>
 
@@ -138,5 +138,7 @@
        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 -r 03559c70318b -r aca5b8b08613 sys/sys/errno.h
--- a/sys/sys/errno.h   Sun Mar 08 22:08:46 2020 +0000
+++ b/sys/sys/errno.h   Sun Mar 08 22:09:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: errno.h,v 1.41 2020/03/08 22:05:40 mgorny Exp $        */
+/*     $NetBSD: errno.h,v 1.42 2020/03/08 22:09:43 mgorny Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -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 -r 03559c70318b -r aca5b8b08613 tests/include/t_errno.c
--- a/tests/include/t_errno.c   Sun Mar 08 22:08:46 2020 +0000
+++ b/tests/include/t_errno.c   Sun Mar 08 22:09:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_errno.c,v 1.1 2011/05/01 17:07:05 jruoho Exp $ */
+/*     $NetBSD: t_errno.c,v 1.2 2020/03/08 22:09:43 mgorny Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_errno.c,v 1.1 2011/05/01 17:07:05 jruoho Exp $");
+__RCSID("$NetBSD: t_errno.c,v 1.2 2020/03/08 22:09:43 mgorny Exp $");
 
 #include <atf-c.h>
 #include <errno.h>
@@ -48,7 +48,6 @@
         * The following definitions should be available
         * according to IEEE Std 1003.1-2008, issue 7.
         */
-       atf_tc_expect_fail("PR standards/44921");
 
        fail = true;
 



Home | Main Index | Thread Index | Old Index