< prev index next >
src/hotspot/os/linux/os_linux.cpp
Print this page
*** 4461,4475 ****
// This boolean allows users to forward their own non-matching signals
// to JVM_handle_linux_signal, harmlessly.
bool os::Linux::signal_handlers_are_installed = false;
// For signal-chaining
- struct sigaction sigact[NSIG];
- uint64_t sigs = 0;
- #if (64 < NSIG-1)
- #error "Not all signals can be encoded in sigs. Adapt its type!"
- #endif
bool os::Linux::libjsig_is_loaded = false;
typedef struct sigaction *(*get_signal_t)(int);
get_signal_t os::Linux::get_signal_action = NULL;
struct sigaction* os::Linux::get_chained_signal_action(int sig) {
--- 4461,4470 ----
*** 4479,4489 ****
// Retrieve the old signal handler from libjsig
actp = (*get_signal_action)(sig);
}
if (actp == NULL) {
// Retrieve the preinstalled signal handler from jvm
! actp = get_preinstalled_handler(sig);
}
return actp;
}
--- 4474,4484 ----
// Retrieve the old signal handler from libjsig
actp = (*get_signal_action)(sig);
}
if (actp == NULL) {
// Retrieve the preinstalled signal handler from jvm
! actp = os::Posix::get_preinstalled_handler(sig);
}
return actp;
}
*** 4543,4565 ****
}
}
return chained;
}
- struct sigaction* os::Linux::get_preinstalled_handler(int sig) {
- if ((((uint64_t)1 << (sig-1)) & sigs) != 0) {
- return &sigact[sig];
- }
- return NULL;
- }
-
- void os::Linux::save_preinstalled_handler(int sig, struct sigaction& oldAct) {
- assert(sig > 0 && sig < NSIG, "vm signal out of expected range");
- sigact[sig] = oldAct;
- sigs |= (uint64_t)1 << (sig-1);
- }
-
// for diagnostic
int sigflags[NSIG];
int os::Linux::get_our_sigflags(int sig) {
assert(sig > 0 && sig < NSIG, "vm signal out of expected range");
--- 4538,4547 ----
*** 4587,4597 ****
if (AllowUserSignalHandlers || !set_installed) {
// Do not overwrite; user takes responsibility to forward to us.
return;
} else if (UseSignalChaining) {
// save the old handler in jvm
! save_preinstalled_handler(sig, oldAct);
// libjsig also interposes the sigaction() call below and saves the
// old sigaction on it own.
} else {
fatal("Encountered unexpected pre-existing sigaction handler "
"%#lx for signal %d.", (long)oldhand, sig);
--- 4569,4579 ----
if (AllowUserSignalHandlers || !set_installed) {
// Do not overwrite; user takes responsibility to forward to us.
return;
} else if (UseSignalChaining) {
// save the old handler in jvm
! os::Posix::save_preinstalled_handler(sig, oldAct);
// libjsig also interposes the sigaction() call below and saves the
// old sigaction on it own.
} else {
fatal("Encountered unexpected pre-existing sigaction handler "
"%#lx for signal %d.", (long)oldhand, sig);
< prev index next >