Module Name: src
Committed By: mgorny
Date: Sun Mar 8 22:09:43 UTC 2020
Modified Files:
src/lib/libc/nls: C.msg
src/lib/libc/sys: intro.2
src/sys/compat/linux/common: linux_errno.c
src/sys/sys: errno.h
src/tests/include: t_errno.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/nls/C.msg
cvs rdiff -u -r1.60 -r1.61 src/lib/libc/sys/intro.2
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/linux/common/linux_errno.c
cvs rdiff -u -r1.41 -r1.42 src/sys/sys/errno.h
cvs rdiff -u -r1.1 -r1.2 src/tests/include/t_errno.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/nls/C.msg
diff -u src/lib/libc/nls/C.msg:1.16 src/lib/libc/nls/C.msg:1.17
--- src/lib/libc/nls/C.msg:1.16 Sun Mar 8 22:06:05 2020
+++ src/lib/libc/nls/C.msg Sun Mar 8 22:09:42 2020
@@ -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
Index: src/lib/libc/sys/intro.2
diff -u src/lib/libc/sys/intro.2:1.60 src/lib/libc/sys/intro.2:1.61
--- src/lib/libc/sys/intro.2:1.60 Mon Jul 3 21:32:50 2017
+++ src/lib/libc/sys/intro.2 Sun Mar 8 22:09:42 2020
@@ -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 @@ Occurs when the link (virtual circuit) c
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
Index: src/sys/compat/linux/common/linux_errno.c
diff -u src/sys/compat/linux/common/linux_errno.c:1.15 src/sys/compat/linux/common/linux_errno.c:1.16
--- src/sys/compat/linux/common/linux_errno.c:1.15 Sun Dec 22 17:14:22 2013
+++ src/sys/compat/linux/common/linux_errno.c Sun Mar 8 22:09:43 2020
@@ -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 @@ 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);
Index: src/sys/sys/errno.h
diff -u src/sys/sys/errno.h:1.41 src/sys/sys/errno.h:1.42
--- src/sys/sys/errno.h:1.41 Sun Mar 8 22:05:40 2020
+++ src/sys/sys/errno.h Sun Mar 8 22:09:43 2020
@@ -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 */
Index: src/tests/include/t_errno.c
diff -u src/tests/include/t_errno.c:1.1 src/tests/include/t_errno.c:1.2
--- src/tests/include/t_errno.c:1.1 Sun May 1 17:07:05 2011
+++ src/tests/include/t_errno.c Sun Mar 8 22:09:43 2020
@@ -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 @@ 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;