Hi!
I'm doing a program where I need to wait until a specific child process ends to go on.
I think this should be easy but somehow the parent doesn't wait for the child to die.
My code is as follows:
Code:
waitpid(p[1], NULL, WNOHANG);
where p[1] is where I have the pid number stored.
What I think is happening is -> the call checks if the child is dead and moves on even if the child isn't dead.
What I want to happen -----> the call checks if the child is dead and if it isn't it stops there until the child dies.