8257572: Deprecate the archaic signal-chaining interfaces: sigset and signal

Reviewed-by: ihse, alanb, dcubed, erikj
This commit is contained in:
David Holmes 2020-12-07 21:56:05 +00:00
parent f92745d73e
commit 149a02f99a
2 changed files with 7 additions and 0 deletions

View File

@ -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, \

View File

@ -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 {