I'm supposed to install a signal handler to call the function stopContinue()
when I receive SIGINT
. Here is my code snippet in C, but I'm not sure if this correct. Please let me know where I'm going wrong.
struct sigaction act;
memset(&act, '\0', sizeof(act));
action.sa_flags = 0;
action.sa_handler = stopContinue;
sigaction(SIGINT, &act, NULL);
Does this look roughly correct?
There is a discussion on using sigaction vs. action, and the use of flags here that is different than another question, this is not a dupe.