waitpid and strace -f
Andreas Schwab
schwab en suse.de
Lun Ene 31 22:03:39 CST 2000
Mike Coleman <mkc en kc.net> writes:
|> "Alexander V. Lukyanov" <lav en long.yar.ru> writes:
|> > The following program receives ECHILD for waitpid when it is run with
|> > `strace -f'. WNOHANG and `-f' are required. I'm not sure if it is
|> > kernel or strace problem.
|>
|> AFAIK, this is correct behavior. As soon as the child runs, it exits, so
|> depending on the order that the parent and child run in, the child may already
|> be gone by the time the waitpid takes place. Thus the ECHILD.
This is wrong. The child will not be gone (but kept around as zombie) as
long as nobody has waited for it. So the waitpid must never return ECHILD
for the first call (assuming the pid is valid).
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
schwab en suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda