1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/Exception.hpp" 10 namespace hmbdc {
namespace os {
28 onTermInt_s() = doThis;
31 memset(&act, 0,
sizeof(act));
32 act.sa_sigaction = handler;
33 act.sa_flags = SA_SIGINFO;
35 if (sigaction(SIGTERM, &act, NULL) ||
36 sigaction(SIGINT, &act, NULL)) {
37 HMBDC_THROW(std::runtime_error,
"cannot install signal handler");
42 static std::function<void()>& onTermInt_s() {
43 static std::function<void()> func;
48 handler(
int signum, siginfo_t *,
void *) {
static void onTermIntDo(std::function< void()> doThis)
specfy what to do when SIGTERM or SIGINT is received
Definition: Signals.hpp:27
provides functions to handle signals
Definition: Signals.hpp:15