7#ifndef CRYPTOPP_OS_SIGNAL_H
8#define CRYPTOPP_OS_SIGNAL_H
12#if defined(UNIX_SIGNALS_AVAILABLE)
16NAMESPACE_BEGIN(CryptoPP)
20#if defined(UNIX_SIGNALS_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
26 typedef void (*SignalHandlerFn) (int);
36 inline void NullSignalHandler(
int unused) {CRYPTOPP_UNUSED(unused);}
57template <
int S,
bool O=false>
78 SignalHandler(SignalHandlerFn pfn = NULLPTR,
int flags = 0) : m_installed(false)
81 struct sigaction new_handler;
87 ret = sigaction (S, 0, &m_old);
91 if (m_old.sa_handler != 0 && !O)
break;
94 ret = sigemptyset (&new_handler.sa_mask);
97 new_handler.sa_handler = (pfn ? pfn : &NullSignalHandler);
98 new_handler.sa_flags = (pfn ? flags : 0);
101 ret = sigaction (S, &new_handler, 0);
112 sigaction (S, &m_old, 0);
116 struct sigaction m_old;
121 SignalHandler(
const SignalHandler &);
122 void operator=(
const SignalHandler &);
Library configuration file.