From 74a4b85d23914c4e51d4c6beff3d0a9f3147ca4e Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 7 Jan 2018 21:14:38 +0000 Subject: Ignore signal 64 for now (go uses it) XXX: pullup-8 --- sys/compat/linux/common/linux_sigaction.c | 13 +++++++++++-- sys/compat/linux/common/linux_signal.c | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'sys/compat/linux/common') diff --git a/sys/compat/linux/common/linux_sigaction.c b/sys/compat/linux/common/linux_sigaction.c index 6aa0793913f..92c890c1cd9 100644 --- a/sys/compat/linux/common/linux_sigaction.c +++ b/sys/compat/linux/common/linux_sigaction.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sigaction.c,v 1.34 2008/10/17 20:21:34 njoly Exp $ */ +/* $NetBSD: linux_sigaction.c,v 1.35 2018/01/07 21:14:38 christos Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sigaction.c,v 1.34 2008/10/17 20:21:34 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sigaction.c,v 1.35 2018/01/07 21:14:38 christos Exp $"); #include #include @@ -84,6 +84,15 @@ linux_sys_sigaction(struct lwp *l, const struct linux_sys_sigaction_args *uap, r linux_old_to_native_sigaction(&nbsa, &nlsa); } sig = SCARG(uap, signum); + /* + * XXX: Linux has 33 realtime signals, the go binary wants to + * reset all of them; nothing else uses the last RT signal, so for + * now ignore it. + */ + if (sig == LINUX__NSIG) { + uprintf("%s: setting signal %d ignored\n", __func__, sig); + sig--; /* back to 63 which is ignored */ + } if (sig < 0 || sig >= LINUX__NSIG) return (EINVAL); if (sig > 0 && !linux_to_native_signo[sig]) { diff --git a/sys/compat/linux/common/linux_signal.c b/sys/compat/linux/common/linux_signal.c index 5e4de41053f..6a949677fa6 100644 --- a/sys/compat/linux/common/linux_signal.c +++ b/sys/compat/linux/common/linux_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_signal.c,v 1.79 2017/02/20 16:30:41 rin Exp $ */ +/* $NetBSD: linux_signal.c,v 1.80 2018/01/07 21:14:38 christos Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.79 2017/02/20 16:30:41 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.80 2018/01/07 21:14:38 christos Exp $"); #define COMPAT_LINUX 1 @@ -346,6 +346,15 @@ linux_sys_rt_sigaction(struct lwp *l, const struct linux_sys_rt_sigaction_args * } sig = SCARG(uap, signum); + /* + * XXX: Linux has 33 realtime signals, the go binary wants to + * reset all of them; nothing else uses the last RT signal, so for + * now ignore it. + */ + if (sig == LINUX__NSIG) { + uprintf("%s: setting signal %d ignored\n", __func__, sig); + sig--; /* back to 63 which is ignored */ + } if (sig < 0 || sig >= LINUX__NSIG) return EINVAL; if (sig > 0 && !linux_to_native_signo[sig]) { -- cgit