< prev index next >

src/java.base/solaris/native/libjsig/jsig.c

Print this page




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /* CopyrightVersion 1.2 */
  26 
  27 /* This is a special library that should be loaded before libc &
  28  * libthread to interpose the signal handler installation functions:
  29  * sigaction(), signal(), sigset().
  30  * Used for signal-chaining. See RFE 4381843.
  31  */
  32 
  33 #include <stdlib.h>
  34 #include <stdio.h>
  35 #include <string.h>
  36 #include <signal.h>
  37 #include <dlfcn.h>
  38 #include <thread.h>
  39 #include <synch.h>
  40 #include "jvm_solaris.h"
  41 
  42 #define bool int
  43 #define true 1
  44 #define false 0
  45 
  46 static struct sigaction *sact = (struct sigaction *)NULL; /* saved signal handlers */
  47 static sigset_t jvmsigs;
  48 
  49 /* used to synchronize the installation of signal handlers */
  50 static mutex_t mutex = DEFAULTMUTEX;
  51 static cond_t cond = DEFAULTCV;
  52 static thread_t tid = 0;
  53 
  54 typedef void (*sa_handler_t)(int);
  55 typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
  56 typedef sa_handler_t (*signal_t)(int, sa_handler_t);
  57 typedef int (*sigaction_t)(int, const struct sigaction *, struct sigaction *);
  58 
  59 static signal_t os_signal = 0; /* os's version of signal()/sigset() */
  60 static sigaction_t os_sigaction = 0; /* os's version of sigaction() */




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /* CopyrightVersion 1.2 */
  26 
  27 /* This is a special library that should be loaded before libc &
  28  * libthread to interpose the signal handler installation functions:
  29  * sigaction(), signal(), sigset().
  30  * Used for signal-chaining. See RFE 4381843.
  31  */
  32 
  33 #include <stdlib.h>
  34 #include <stdio.h>
  35 #include <string.h>
  36 #include <signal.h>
  37 #include <dlfcn.h>
  38 #include <thread.h>
  39 #include <synch.h>
  40 #include "jvm_md.h"
  41 
  42 #define bool int
  43 #define true 1
  44 #define false 0
  45 
  46 static struct sigaction *sact = (struct sigaction *)NULL; /* saved signal handlers */
  47 static sigset_t jvmsigs;
  48 
  49 /* used to synchronize the installation of signal handlers */
  50 static mutex_t mutex = DEFAULTMUTEX;
  51 static cond_t cond = DEFAULTCV;
  52 static thread_t tid = 0;
  53 
  54 typedef void (*sa_handler_t)(int);
  55 typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
  56 typedef sa_handler_t (*signal_t)(int, sa_handler_t);
  57 typedef int (*sigaction_t)(int, const struct sigaction *, struct sigaction *);
  58 
  59 static signal_t os_signal = 0; /* os's version of signal()/sigset() */
  60 static sigaction_t os_sigaction = 0; /* os's version of sigaction() */


< prev index next >