10#ifndef __BE_ERROR_SIGNAL_MANAGER_H__
11#define __BE_ERROR_SIGNAL_MANAGER_H__
22#define BEGIN_SIGNAL_BLOCK(_sigmgr, _blockname) do { \
23 if (!(_sigmgr)->isEnabled()) \
25 (_sigmgr)->clearSigHandled(); \
28 BiometricEvaluation::Error::SignalManager::_sigJumpBuf, 1) != 0) \
30 (_sigmgr)->setSigHandled(); \
31 goto _blockname ## _end; \
36#define END_SIGNAL_BLOCK(_sigmgr, _blockname) do { \
37 if (!(_sigmgr)->isEnabled()) \
43#define ABORT_SIGNAL_MANAGER(_sigmgr) do { \
44 if (!(_sigmgr)->isEnabled()) \
124 const sigset_t signalSet);
139 const sigset_t signalSet);
231 bool _sigHandled{
false};
244 siginfo_t *info,
void *uap);
A SignalManager object is used to handle signals that come from the operating system.
static sigjmp_buf _sigJumpBuf
The jump buffer used by the signal handler.
void setSignalSet(const sigset_t signalSet)
Set the signals this object will manage.
void start()
Start handling signals of the current signal set.
void clearSigHandled()
Clear the indication that a signal was handled.
void stop()
Stop handling signals of the current signal set.
SignalManager(const sigset_t signalSet)
Construct a new SignalManager object with the specified signal handling, no defaults.
bool sigHandled()
Indicate whether a signal was handled.
bool isEnabled() const
Check the enabled status of signal handling.
void setEnabled(const bool enabled)
Enable or disable signal handling.
void setSigHandled()
Set a flag to indicate a signal was handled.
SignalManager()
Construct a new SignalManager object with the default signal handling: SIGSEGV and SIGBUS.
static bool _canSigJump
Flag indicating can jump after handling a signal.
void clearSignalSet()
Clear all signal handling.
void setDefaultSignalSet()
Set the default signals this object will manage: SIGSEGV and SIGBUS.
void SignalManagerSighandler(int signo, siginfo_t *info, void *uap)
This software was developed at the National Institute of Standards and Technology (NIST) by employees...