hotspot/src/os/linux/vm/jsig.c
author hseigel
Wed, 01 Mar 2017 08:00:02 -0500
changeset 46194 5596e6f63072
parent 34145 f8097485b483
permissions -rw-r--r--
8172307: Remove ununsed JVM API JVM_GetModuleByPackageName() Summary: Remove get_module_by_package_name() etc., and unneeded test. Reviewed-by: sspitsyn, gtriantafill
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
18939
2afa9e202276 8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents: 7397
diff changeset
     2
 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
/* CopyrightVersion 1.2 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
/* This is a special library that should be loaded before libc &
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
 * libthread to interpose the signal handler installation functions:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
 * sigaction(), signal(), sigset().
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
 * Used for signal-chaining. See RFE 4381843.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
#include <signal.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
#include <dlfcn.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
#include <pthread.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
#include <stdio.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
#include <stdlib.h>
34145
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    38
#include <stdint.h>
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
#define bool int
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
#define true 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
#define false 0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
34145
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    44
#define MASK(sig) ((uint64_t)1 << (sig-1))  // 0 is not a signal.
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    45
// Check whether all signals fit into jvmsigs. -1 as MASK shifts by -1.
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    46
#if (64 < NSIG-1)
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    47
#error "Not all signals can be encoded in jvmsigs. Adapt its type!"
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    48
#endif
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    49
static struct sigaction sact[NSIG]; /* saved signal handlers */
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
    50
static uint64_t jvmsigs = 0; /* signals used by jvm */
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
/* used to synchronize the installation of signal handlers */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
static pthread_t tid = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
typedef void (*sa_handler_t)(int);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
typedef sa_handler_t (*signal_t)(int, sa_handler_t);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
typedef int (*sigaction_t)(int, const struct sigaction *, struct sigaction *);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
static signal_t os_signal = 0; /* os's version of signal()/sigset() */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
static sigaction_t os_sigaction = 0; /* os's version of sigaction() */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
static bool jvm_signal_installing = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
static bool jvm_signal_installed = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
static void signal_lock() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  pthread_mutex_lock(&mutex);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  /* When the jvm is installing its set of signal handlers, threads
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
   * other than the jvm thread should wait */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  if (jvm_signal_installing) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    if (tid != pthread_self()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
      pthread_cond_wait(&cond, &mutex);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
static void signal_unlock() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  pthread_mutex_unlock(&mutex);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
static sa_handler_t call_os_signal(int sig, sa_handler_t disp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
                                   bool is_sigset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  if (os_signal == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    if (!is_sigset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
      os_signal = (signal_t)dlsym(RTLD_NEXT, "signal");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
      os_signal = (signal_t)dlsym(RTLD_NEXT, "sigset");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
    if (os_signal == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
      printf("%s\n", dlerror());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
      exit(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  return (*os_signal)(sig, disp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
static void save_signal_handler(int sig, sa_handler_t disp) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  sigset_t set;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  sact[sig].sa_handler = disp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  sigemptyset(&set);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  sact[sig].sa_mask = set;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  sact[sig].sa_flags = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
static sa_handler_t set_signal(int sig, sa_handler_t disp, bool is_sigset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  sa_handler_t oldhandler;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  bool sigused;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  signal_lock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
34145
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
   113
  sigused = (sig < NSIG) && ((MASK(sig) & jvmsigs) != 0);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  if (jvm_signal_installed && sigused) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    /* jvm has installed its signal handler for this signal. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    /* Save the handler. Don't really install it. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    oldhandler = sact[sig].sa_handler;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    save_signal_handler(sig, disp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
    return oldhandler;
34145
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
   122
  } else if (sig < NSIG && jvm_signal_installing) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    /* jvm is installing its signal handlers. Install the new
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
     * handlers and save the old ones. jvm uses sigaction().
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
     * Leave the piece here just in case. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    oldhandler = call_os_signal(sig, disp, is_sigset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    save_signal_handler(sig, oldhandler);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    /* Record the signals used by jvm */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
    jvmsigs |= MASK(sig);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    return oldhandler;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
    /* jvm has no relation with this signal (yet). Install the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
     * the handler. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    oldhandler = call_os_signal(sig, disp, is_sigset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
    signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    return oldhandler;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
sa_handler_t signal(int sig, sa_handler_t disp) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  return set_signal(sig, disp, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
sa_handler_t sigset(int sig, sa_handler_t disp) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  return set_signal(sig, disp, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
 }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
static int call_os_sigaction(int sig, const struct sigaction  *act,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
                             struct sigaction *oact) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  if (os_sigaction == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
    os_sigaction = (sigaction_t)dlsym(RTLD_NEXT, "sigaction");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    if (os_sigaction == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
      printf("%s\n", dlerror());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
      exit(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  return (*os_sigaction)(sig, act, oact);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  int res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  bool sigused;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  struct sigaction oldAct;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  signal_lock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
34145
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
   171
  sigused = (sig < NSIG) && ((MASK(sig) & jvmsigs) != 0);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  if (jvm_signal_installed && sigused) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
    /* jvm has installed its signal handler for this signal. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    /* Save the handler. Don't really install it. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    if (oact != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
      *oact = sact[sig];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    if (act != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
      sact[sig] = *act;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
    signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
    return 0;
34145
f8097485b483 8141529: Fix handling of _JAVA_SR_SIGNUM
goetz
parents: 18939
diff changeset
   184
  } else if (sig < NSIG && jvm_signal_installing) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
    /* jvm is installing its signal handlers. Install the new
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
     * handlers and save the old ones. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    res = call_os_sigaction(sig, act, &oldAct);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
    sact[sig] = oldAct;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
    if (oact != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
      *oact = oldAct;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
    /* Record the signals used by jvm */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
    jvmsigs |= MASK(sig);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
    return res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
    /* jvm has no relation with this signal (yet). Install the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
     * the handler. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
    res = call_os_sigaction(sig, act, oact);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
    return res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
/* The three functions for the jvm to call into */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
void JVM_begin_signal_setting() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  signal_lock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  jvm_signal_installing = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  tid = pthread_self();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
void JVM_end_signal_setting() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  signal_lock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  jvm_signal_installed = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  jvm_signal_installing = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  pthread_cond_broadcast(&cond);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  signal_unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
struct sigaction *JVM_get_signal_action(int sig) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  /* Does race condition make sense here? */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  if ((MASK(sig) & jvmsigs) != 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
    return &sact[sig];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
}