I’ve succesfully attached a handler function to SIG_INT and SIG_KILL but now I would like to be able to “unbind” the handler at a certain point (after a fork to be precise). This is how I attach the handler:
struct sigaction sa;
sa.sa_handler = interrupt_handler;
sigempty(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sigaction(SIG_INT, &sa, NULL);
sigaction(SIG_KILL, &sa, NULL);
interrupt_handler only prints something.
You probably want to restore the previous disposition: