From 329e37cd132f9cf72a596e42c9f533e21e212349 Mon Sep 17 00:00:00 2001 From: kamil Date: Wed, 3 Apr 2019 08:19:46 +0000 Subject: [PATCH] The *fork*_signalmasked ATF tests no longer fail Add a fixup for signalmasking in the vforkdone_singalmasked test. --- tests/lib/libc/sys/t_ptrace_wait.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/lib/libc/sys/t_ptrace_wait.c b/tests/lib/libc/sys/t_ptrace_wait.c index 8798463f16be..03aa1cfdb904 100644 --- a/tests/lib/libc/sys/t_ptrace_wait.c +++ b/tests/lib/libc/sys/t_ptrace_wait.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.101 2019/03/28 08:13:40 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.102 2019/04/03 08:19:46 kamil Exp $ */ /*- * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.101 2019/03/28 08:13:40 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.102 2019/04/03 08:19:46 kamil Exp $"); #include #include @@ -5221,9 +5221,6 @@ fork2_body(bool trackfork, bool trackvfork, bool trackvforkdone, bool masked, ki_sigset_t kp_sigmask; ki_sigset_t kp_sigignore; - if (masked) - atf_tc_expect_fail("Masked signal invisible to tracer"); - if (trackfork) fn = fork; if (trackvfork || trackvforkdone) @@ -5447,6 +5444,12 @@ fork2_body(bool trackfork, bool trackvfork, bool trackvforkdone, bool masked, name[3] = child; ATF_REQUIRE_EQ(sysctl(name, namelen, &kp, &len, NULL, 0), 0); + /* + * SIGCHLD is now pending in the signal queue and + * the kernel presents it to userland as a masked signal. + */ + sigdelset((sigset_t *)&kp.p_sigmask, SIGCHLD); + if (masked) { DPRINTF("kp_sigmask=" "%#02" PRIx32 "%02" PRIx32 "%02" PRIx32 "%02"