Skip to content
Permalink
Browse files
8257572: Deprecate the archaic signal-chaining interfaces: sigset and…
… signal

Reviewed-by: ihse, alanb, dcubed, erikj
  • Loading branch information
David Holmes committed Dec 7, 2020
1 parent f92745d commit 149a02f99a10f42431bfa58ad7508f32285c33be
Showing with 7 additions and 0 deletions.
  1. +1 −0 make/modules/java.base/Lib.gmk
  2. +6 −0 src/java.base/unix/native/libjsig/jsig.c
@@ -128,6 +128,7 @@ endif

ifeq ($(call isTargetOsType, unix), true)
ifeq ($(STATIC_BUILD), false)
LIBJSIG_CFLAGS += -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"'
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
NAME := jsig, \
OPTIMIZATION := LOW, \
@@ -29,6 +29,8 @@
* libthread to interpose the signal handler installation functions:
* sigaction(), signal(), sigset().
* Used for signal-chaining. See RFE 4381843.
* Use of signal() and sigset() is now deprecated as these old API's should
* not be used - sigaction is the only truly supported API.
*/

#include "jni.h"
@@ -99,6 +101,10 @@ static sa_handler_t call_os_signal(int sig, sa_handler_t disp,
sa_handler_t res;

if (os_signal == NULL) {
// Deprecation warning first time through
printf(HOTSPOT_VM_DISTRO " VM warning: the use of signal() and sigset() "
"for signal chaining was deprecated in version 16.0 and will "
"be removed in a future release. Use sigaction() instead.\n");
if (!is_sigset) {
os_signal = (signal_function_t)dlsym(RTLD_NEXT, "signal");
} else {

1 comment on commit 149a02f

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 149a02f Dec 7, 2020

Please sign in to comment.