From 54be25b07b258b0141759df36d1e3807164f2c7e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 22 Oct 2019 22:00:21 -0400 Subject: [PATCH] 8232571: Add missing SIGINFO signal Reviewed-by: dholmes, rriggs --- src/hotspot/os/posix/os_posix.cpp | 3 ++ .../jtreg/runtime/signal/TestSiginfo.java | 35 +++++++++++++++++++ test/jdk/sun/misc/SunMiscSignalTest.java | 4 ++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/runtime/signal/TestSiginfo.java diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 5378c0efc50..8e52bdf7426 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -685,6 +685,9 @@ static const struct { #endif { SIGHUP, "SIGHUP" }, { SIGILL, "SIGILL" }, +#ifdef SIGINFO + { SIGINFO, "SIGINFO" }, +#endif { SIGINT, "SIGINT" }, #ifdef SIGIO { SIGIO, "SIGIO" }, diff --git a/test/hotspot/jtreg/runtime/signal/TestSiginfo.java b/test/hotspot/jtreg/runtime/signal/TestSiginfo.java new file mode 100644 index 00000000000..b2718cb6a5a --- /dev/null +++ b/test/hotspot/jtreg/runtime/signal/TestSiginfo.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @requires os.family != "windows" & os.family != "aix" + * + * @summary tests the SIGINFO signal (available on BSD platforms) + * VM testbase keywords: [signal, runtime, linux, solaris, macosx] + * + * @library /test/lib + * @run main/native SigTestDriver SIGINFO + */ + diff --git a/test/jdk/sun/misc/SunMiscSignalTest.java b/test/jdk/sun/misc/SunMiscSignalTest.java index e2c647b4424..dd45ec179b0 100644 --- a/test/jdk/sun/misc/SunMiscSignalTest.java +++ b/test/jdk/sun/misc/SunMiscSignalTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,10 +133,12 @@ public class SunMiscSignalTest { Object[][] posixNonOSXSignals = { {"BUS", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs}, + {"INFO", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO}, }; Object[][] posixOSXSignals = { {"BUS", IsSupported.YES, CanRegister.NO, CanRaise.NO, Invoked.NO}, + {"INFO", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs}, }; Object[][] windowsSignals = {