38 static std::array<std::function<void(
Signal)>, Leosac::Tools::num_signals>
41 static void fesser_e(
int signal)
43 assert(signal > 0 && signal < Leosac::Tools::num_signals);
44 if (sigCallback[signal])
45 sigCallback[signal](
static_cast<Signal>(signal));
49 std::function<
void(
Signal)> callback)
53 act.sa_handler = &fesser_e;
54 if (sigemptyset(&act.sa_mask) < 0)
56 act.sa_flags = SA_RESTART;
57 if (sigaction(
static_cast<int>(signal), &act, 0) < 0)
59 assert(
static_cast<int>(signal) > 0 &&
60 static_cast<int>(signal) < Leosac::Tools::num_signals);
61 sigCallback[
static_cast<int>(signal)] = callback;