private static void resetSignal(int signo) throws NativeCallException {
    LibC libc = checkLibc();

    Memory sa = new Memory(LibCConstants.MAX_SIZEOF_STRUCT_SIGACTION);
    if (libc.sigaction(signo, Pointer.NULL, sa) == -1) {
      throw libcCallError("sigaction(" + signo + ")");
    }
    if (!LibCConstants.SIG_IGN.equals(sa.getPointer(0))) {
      // It's SIG_DFL, or there's a handler installed by the JVM, which is the reason we need this check.
      // Otherwise we could end up resetting, for example, a handler for SIGSEGV (used by the JVM extensively for its own purposes)
      // to the default action for that signal - termination, and the VM would die horribly killed by the OS with no mercy whatsoever.
      //
      // In either case, be it SIG_DFL or a handler, the signal action will reset to SIG_DFL upon exec() from a forked child.
      return;
    }

    if (libc.signal(signo, LibCConstants.SIG_DFL) == LibCConstants.SIG_ERR) {
      throw libcCallError("signal(" + signo + ")");
    }
    System.err.println("Restored ignored signal " + signo + " handler to default");
  }
private static void resetSignal(int signo)