hi....
I read abt a method to make a parent process wait() for all its children to exit before it can exit using the signal system call...
It involved setting the action for the SIGCHLD signal to SIG_IGN (ignore)
So what i did was
Code:
signal(SIGCHLD,SIG_IGN);
/**** The forking stuff ****/
ret = wait(&wait_val) ;
As per the book what should happen is that the signal SIGCHLD should be ignored and so on recieving the signal the parent just ignores the signal and continues to wait... until all the children have exited... .. When there are no more processes the wait system call returns
But as per the man page signal(2) tells that behavior of SIGCHLD signal with SIG_IGN set is undefined
Is there any way to rectify this???
tuxfood