/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/* CopyrightVersion 1.2 */
/* This is a special library that should be loaded before libc &
* libthread to interpose the signal handler installation functions:
* sigaction(), signal(), sigset().
* Used for signal-chaining. See RFE 4381843.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <dlfcn.h>
#include <thread.h>
#include <synch.h>
#include "jvm_solaris.h"
#define bool int
#define true 1
#define false 0
/* used to synchronize the installation of signal handlers */
typedef void (*sa_handler_t)(int);
static bool jvm_signal_installing = false;
static bool jvm_signal_installed = false;
/* assume called within signal_lock */
static void allocate_sact() {
}
exit(0);
}
}
static void signal_lock() {
mutex_lock(&mutex);
/* When the jvm is installing its set of signal handlers, threads
* other than the jvm thread should wait */
if (jvm_signal_installing) {
}
}
}
static void signal_unlock() {
}
bool is_sigset) {
if (!is_sigset) {
} else {
}
exit(0);
}
}
}
}
sigemptyset(&set);
if (!is_sigset) {
}
} else {
}
}
bool sigblocked;
signal_lock();
}
/* jvm has installed its signal handler for this signal. */
/* Save the handler. Don't really install it. */
if (is_sigset) {
/* We won't honor the SIG_HOLD request to change the signal mask */
}
if (is_sigset && sigblocked) {
}
return oldhandler;
} else if (jvm_signal_installing) {
/* jvm is installing its signal handlers. Install the new
* handlers and save the old ones. jvm uses sigaction().
* Leave the piece here just in case. */
/* Record the signals used by jvm */
return oldhandler;
} else {
/* jvm has no relation with this signal (yet). Install the
* the handler. */
return oldhandler;
}
}
}
}
if (os_sigaction == NULL) {
if (os_sigaction == NULL) {
exit(0);
}
}
}
int res;
signal_lock();
}
/* jvm has installed its signal handler for this signal. */
/* Save the handler. Don't really install it. */
}
}
return 0;
} else if (jvm_signal_installing) {
/* jvm is installing its signal handlers. Install the new
* handlers and save the old ones. */
}
/* Record the signals used by jvm */
return res;
} else {
/* jvm has no relation with this signal (yet). Install the
* the handler. */
return res;
}
}
/* The four functions for the jvm to call into */
void JVM_begin_signal_setting() {
signal_lock();
jvm_signal_installing = true;
}
void JVM_end_signal_setting() {
signal_lock();
jvm_signal_installed = true;
jvm_signal_installing = false;
}
}
/* Does race condition make sense here? */
}
return NULL;
}
int JVM_get_libjsig_version() {
return JSIG_VERSION_1_4_1;
}