If I understand what you're saying, sleep(1) in child1, and
sleep(2) in the parent should fix the problem, which it doesn't.
And it still doesn't explain why it only happens with 2 childs.
Maybe I should have mentioned this before: the wait will clean up
the first child at the time the second child dies, or atleast
that's what wait() returns.
> > if (!fork())
> > {
> > /* Child 1. */
> sleep(2);
> > return 0;
> > }
>
> The above change is continued the parent after 2 seconds.
I know that too, as I said, only when child 1 dies before the
parent calls wait().
Kurt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/