I have the following problem:
I have basic (parent) procces that create other processes (childs) using the fork function. I am fond of childhood status to destroy zombies. When there is 1 child process, it is checked correctly, but when there are more processes (aprx. 30) created by the parent process, there is aprx. 4 zombies left = parent does not catch all children (return status / state = <defunct>).
The state of the child is fixed using
void selfkill(int status) {
wait(&status);
}
signal(SIGCHLD, selfkill);
Thanks in advance.
source
share