Name: Anonymous 2010-12-08 7:48
I need to make something in a way that when a program receives a SIGINT/SIGTERM all the processes in this program's process group that receives this signal get killed.
Will the following work?
Some guys told me that this should suffice, and that I should also consider substituting signal for sigaction.
What do you think?
Will the following work?
//shit done in the main:
pid = fork();
signal(SIGINT, (__sighandler_t) murder);
signal(SIGTERM, (__sighandler_t) murder);
//moreblabla
void murder(void)
{
lol(); // frees shared memory and semaphores;
kill(0, 9);
}Some guys told me that this should suffice, and that I should also consider substituting signal for sigaction.
What do you think?