I am trying to develop 3 different child processes from a parent (and run this in a UNIX box) and I want to have this requirement:
The parent must wait for all three child processes to complete.
I use waitfor the same. Here's the code snippet:
#include <unistd.h>
#include <sys/signal.h>
#include <sys/types.h>
#include <sys/wait.h>
int main()
{
int stat;
Finally, in the parent, I do this:
wait (&stat);
/* ... */
return 0;
}
Question:
Do I need to call waitthree times or is one call enough? I need to know how this works.
source
share