Don't send SIGINT on CTRL+C to child processes but don't ignore the signal itself
问题 I'm trying to write a Task control program, very much like Supervisor. I run some programs from a config file and let them run in the background, while in the main process I read and execute other commands. Before fork() -ing, in the main process I call: sigaction(SIGINT, &the_handler, NULL); Where the_handler stores the reference of a simple print function. When CTRL+C is pressed, the child processes are interrupted as well (which I don't want). I could run: signal(SIGINT, SIG_IGN); after