7 #ifndef CRYPTOPP_OS_SIGNAL_H 8 #define CRYPTOPP_OS_SIGNAL_H 12 #if defined(UNIX_SIGNALS_AVAILABLE) 20 #if defined(UNIX_SIGNALS_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) 26 typedef void (*SignalHandlerFn) (int);
53 template <
int S,
bool O=false>
70 SignalHandler(SignalHandlerFn pfn = NULL,
int flags = 0) : m_installed(false)
73 struct sigaction new_handler;
79 ret = sigaction (
S, 0, &m_old);
83 if (m_old.sa_handler != 0 && !O)
break;
85 #if defined __CYGWIN__ 87 memset(&new_handler, 0x00,
sizeof(new_handler));
89 ret = sigemptyset (&new_handler.sa_mask);
93 new_handler.sa_handler = (pfn ? pfn : &NullSignalHandler);
94 new_handler.sa_flags = (pfn ? flags : 0);
97 ret = sigaction (
S, &new_handler, 0);
108 sigaction (
S, &m_old, 0);
112 struct sigaction m_old;
117 SignalHandler(
const SignalHandler &);
118 void operator=(
const SignalHandler &);
124 #endif // CRYPTOPP_OS_SIGNAL_H #define NAMESPACE_BEGIN(x)
Library configuration file.
#define CRYPTOPP_UNUSED(x)