![]() |
Signal Chaining |
The signal-chaining facility has two components.
The signal-chaining facility was introduced to remedy a problem with signal handling in previous versions of the VM. Prior to version 1.4, the VM would not allow pre-installed signal handlers for SIGBUS, SIGSEGV, SIGILL, SIGFPE, SIGPIPE, and SIGUSR1. Those signal handlers could conflict with the signal handlers used by the VM. An application cannot change signal handlers itself, for example in JNI code, because then some signals generated by the VM would not be handled by the VM.
The new signal-chaining facility in J2SDK 1.4 supports pre-installed signal handlers by saving any preinstalled signal handlers at the time the VM is created. If the signals are raised later, the VM invokes the pre-installed handler.
The signal-chaining facility also links and loads shared library libjsig.so with applications. This library ensures that calls such as signal(), sigset(), and sigaction() are intercepted so they won't actuall replace the VM's signal handlers. Instead, these calls will save the new signal handler. Later when the signal is raised, the VM will call into libjsig.so to retrieve and invoke the saved handler.
Copyright © 2001 Sun Microsystems, Inc. All Rights Reserved. |
![]() |