I'm writing a program where I need to catch SIGINT
signal so that I can kill child processes without the parent process exiting. I can kill child processes by sending them SIGKILL
.
But after a signal is handled the main program resumes from where it left off. I want it to resume from somewhere else. For example say I have a loop and a signal is caught somewhere within loop; after handling the signal I want the program to resume from the beginning of the loop, rather than the middle.