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.
This commit is contained in:
mgorny 2020-03-08 22:09:42 +00:00
parent 5fb02e28e8
commit 558ea2bcab
5 changed files with 22 additions and 8 deletions

View File

@ -191,6 +191,10 @@ $ ENOLINK
95 Link has been severed 95 Link has been severed
$ EPROTO $ EPROTO
96 Protocol error 96 Protocol error
$ EOWNERDEAD
97 Previous owner died
$ ENOTRECOVERABLE
98 State not recoverable
$set 2 $set 2
$ SIGHUP $ SIGHUP
1 Hangup 1 Hangup

View File

@ -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 .\" Copyright (c) 1980, 1983, 1986, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -505,6 +505,11 @@ Occurs when the link (virtual circuit) connecting to a remote machine is gone.
Some protocol error occurred. Some protocol error occurred.
This error is device-specific, but is generally not related to a hardware This error is device-specific, but is generally not related to a hardware
failure. 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 .El
.Sh DEFINITIONS .Sh DEFINITIONS
.Bl -tag -width Ds .Bl -tag -width Ds

View File

@ -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. * Copyright (c) 1995 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/ */
#include <sys/cdefs.h> #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> #include <sys/errno.h>
@ -138,5 +138,7 @@ const int native_to_linux_errno[] = {
LINUX_SCERR_SIGN LINUX_EMULTIHOP, LINUX_SCERR_SIGN LINUX_EMULTIHOP,
LINUX_SCERR_SIGN LINUX_ENOLINK, LINUX_SCERR_SIGN LINUX_ENOLINK,
LINUX_SCERR_SIGN LINUX_EPROTO, /* 96 */ LINUX_SCERR_SIGN LINUX_EPROTO, /* 96 */
LINUX_SCERR_SIGN LINUX_EOWNERDEAD,
LINUX_SCERR_SIGN LINUX_ENOTRECOVERABLE,
}; };
__CTASSERT(__arraycount(native_to_linux_errno) == ELAST + 1); __CTASSERT(__arraycount(native_to_linux_errno) == ELAST + 1);

View File

@ -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 * Copyright (c) 1982, 1986, 1989, 1993
@ -172,7 +172,11 @@
#define ENOLINK 95 /* Link has been severed */ #define ENOLINK 95 /* Link has been severed */
#define EPROTO 96 /* Protocol error */ #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) #if defined(_KERNEL) || defined(_KMEMUSER)
/* pseudo-errors returned inside kernel to modify return to process */ /* pseudo-errors returned inside kernel to modify return to process */

View File

@ -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. * Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <sys/cdefs.h> #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 <atf-c.h>
#include <errno.h> #include <errno.h>
@ -48,7 +48,6 @@ ATF_TC_BODY(errno_constants, tc)
* The following definitions should be available * The following definitions should be available
* according to IEEE Std 1003.1-2008, issue 7. * according to IEEE Std 1003.1-2008, issue 7.
*/ */
atf_tc_expect_fail("PR standards/44921");
fail = true; fail = true;