#include<stdio.h>
#include<signal.h>
void handler(int signo)
{
printf("Into handler\n");
while(1);
}
int main()
{
struct sigaction act;
act.sa_handler = handler;
act.sa_flags = 0;
sigemptyset(& act.sa_mask);
sigaction(SIGINT, &act, NULL);
while(1);
return 0;
}
After catching the KeyboardInterrupt once, when I press "Ctrl+C" again, SIGINT is not handled... I intend that "Into handler" should be printed each time I press "Ctrl+C".
I want to catch SIGINT inside the "SIGINT handler()" itself..