lkml.org 
[lkml]   [2000]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: waitpid and strace -f
From
Date
"Alexander V. Lukyanov" <lav@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.

--Mike


> pid=fork();
> if(pid==0)
> _exit(0);
> if(waitpid(pid,&st,WNOHANG)==-1)
> perror("waitpid");

--
Any sufficiently adverse technology is indistinguishable from Microsoft.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.532 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site