NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
|
A SignalManager object is used to handle signals that come from the operating system. More...
#include <be_error_signal_manager.h>
Public Member Functions | |
SignalManager () | |
Construct a new SignalManager object with the default signal handling: SIGSEGV and SIGBUS. More... | |
SignalManager (const sigset_t signalSet) | |
Construct a new SignalManager object with the specified signal handling, no defaults. More... | |
void | setSignalSet (const sigset_t signalSet) |
Set the signals this object will manage. More... | |
void | clearSignalSet () |
Clear all signal handling. More... | |
void | setDefaultSignalSet () |
Set the default signals this object will manage: SIGSEGV and SIGBUS. More... | |
bool | sigHandled () |
Indicate whether a signal was handled. More... | |
void | start () |
Start handling signals of the current signal set. More... | |
void | stop () |
Stop handling signals of the current signal set. More... | |
void | setSigHandled () |
Set a flag to indicate a signal was handled. More... | |
void | clearSigHandled () |
Clear the indication that a signal was handled. More... | |
void | setEnabled (const bool enabled) |
Enable or disable signal handling. More... | |
bool | isEnabled () const |
Check the enabled status of signal handling. More... | |
Static Public Attributes | |
static bool | _canSigJump |
Flag indicating can jump after handling a signal. More... | |
static sigjmp_buf | _sigJumpBuf |
The jump buffer used by the signal handler. More... | |
A SignalManager object is used to handle signals that come from the operating system.
Applications typically do not invoke most methods of a SignalManager, except the setSignalSet(), setDefaultSignalSet(), and sigHandled(). An application wishing to just catch memory errors can simply construct a SignalManager object, and invoke sigHandled() at the end of the signal block to detect whether a signal was handled.
The BEGIN_SIGNAL_BLOCK macro sets up the jump block and tells the SignalManager object to start handling signals. Applications can call either setSignalSet() or setDefaultSignalSet() before invoking these macros to indicate which signals are to be handled.
The END_SIGNAL_BLOCK() macro clears the signal set, so from that point forward application code signals will be handled in the system's default manner until another signal block is created.
The ABORT_SIGNAL_MANAGER() macro also disables the watchdog timer but does not create the code point destination for the jump point. This macro should be used to disable a SignalManager object when the application is no longer interested in the signal handling.
A SignalManager is passive (i.e. no signal handlers are installed) until that start() method is called, and becomes passive when stop() is invoked. The signals that are to be handled by the object are maitained as state, and the set of signals can be changed at any time, but are not in effect until start() is called.
Definition at line 96 of file be_error_signal_manager.h.
BiometricEvaluation::Error::SignalManager::SignalManager | ( | ) |
Construct a new SignalManager object with the default signal handling: SIGSEGV and SIGBUS.
Error::StrategyError | Could not register the signal handler. |
BiometricEvaluation::Error::SignalManager::SignalManager | ( | const sigset_t | signalSet | ) |
Construct a new SignalManager object with the specified signal handling, no defaults.
signalSet | (in) The signal set; see sigaction(2), sigemptyset(3) and sigaddset(3). |
Error::ParameterError | One of the signals in signalSet cannot be handled (SIGKILL, SIGSTOP.). |
void BiometricEvaluation::Error::SignalManager::setSignalSet | ( | const sigset_t | signalSet | ) |
Set the signals this object will manage.
signalSet | (in) The signal set; see sigaction(2), sigemptyset(3) and sigaddset(3). |
Error::ParameterError | One of the signals in signalSet cannot be handled (SIGKILL, SIGSTOP.). |
void BiometricEvaluation::Error::SignalManager::clearSignalSet | ( | ) |
Clear all signal handling.
void BiometricEvaluation::Error::SignalManager::setDefaultSignalSet | ( | ) |
Set the default signals this object will manage: SIGSEGV and SIGBUS.
bool BiometricEvaluation::Error::SignalManager::sigHandled | ( | ) |
Indicate whether a signal was handled.
void BiometricEvaluation::Error::SignalManager::start | ( | ) |
Start handling signals of the current signal set.
Error::StrategyError | Could not register the signal handler. |
void BiometricEvaluation::Error::SignalManager::stop | ( | ) |
Stop handling signals of the current signal set.
Error::StrategyError | Could not register the signal handler. |
void BiometricEvaluation::Error::SignalManager::setSigHandled | ( | ) |
Set a flag to indicate a signal was handled.
void BiometricEvaluation::Error::SignalManager::clearSigHandled | ( | ) |
Clear the indication that a signal was handled.
void BiometricEvaluation::Error::SignalManager::setEnabled | ( | const bool | enabled | ) |
Enable or disable signal handling.
enabled | true if enabled, false otherwise. |
bool BiometricEvaluation::Error::SignalManager::isEnabled | ( | ) | const |
Check the enabled status of signal handling.
|
static |
Flag indicating can jump after handling a signal.
Definition at line 210 of file be_error_signal_manager.h.
|
static |
The jump buffer used by the signal handler.
Definition at line 215 of file be_error_signal_manager.h.