src/hotspot/os/posix/os_posix.cpp
changeset 50177 9806f23d5e5e
parent 49594 898ef81cbc0e
child 50333 7cea35f78b50
--- a/src/hotspot/os/posix/os_posix.cpp	Fri May 18 10:59:04 2018 +0200
+++ b/src/hotspot/os/posix/os_posix.cpp	Fri May 18 08:47:42 2018 -0400
@@ -926,6 +926,18 @@
 #endif
 }
 
+bool os::Posix::is_sig_ignored(int sig) {
+  struct sigaction oact;
+  sigaction(sig, (struct sigaction*)NULL, &oact);
+  void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*,  oact.sa_sigaction)
+                                 : CAST_FROM_FN_PTR(void*,  oact.sa_handler);
+  if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
 // Returns:
 // NULL for an invalid signal number
 // "SIG<num>" for a valid but unknown signal number