9 static struct sigaction action = {0};
18 size = backtrace(array, 10);
21 backtrace_symbols_fd(array, size, STDERR_FILENO);
28 printf(
"gracefullexit\n");
40 printf(
"Signal %d received\n", signo);
55 if (handler == NULL) {
56 printf(
"fault_handler_undefined using deafult_fault_handler\n");
62 action.sa_flags = SA_SIGINFO;
63 action.sa_sigaction = handler;
66 if (sigaction(SIGFPE, &action, NULL) == -1) {
67 perror(
"sigfpe: sigaction");
71 if (sigaction(SIGSEGV, &action, NULL) == -1) {
72 perror(
"sigsegv: sigaction");
76 if (sigaction(SIGILL, &action, NULL) == -1) {
77 perror(
"sigill: sigaction");
81 if (sigaction(SIGINT, &action, NULL) == -1) {
82 perror(
"sigint: sigaction");
86 if (sigaction(SIGTERM, &action, NULL) == -1) {
87 perror(
"sigterm: sigaction");
Top level include containg common headers.
void dummy_fault_handler()
void fault_manager_init(f_fault_handle handler)
Handles signals and faults depending on type of fault/signal occured
void default_fault_handler(int signo, siginfo_t *info, void *extra)
Defaul fault handler called on any of the signals initialised to be handled
void(* f_fault_handle)(int, siginfo_t *, void *)
Function pointer for fault handler.
void mem_finit(void)
Close memory module by checking and destroying if any tagged memory