This is the mail archive of the
cygwin-developers@sources.redhat.com
mailing list for the Cygwin project.
Re: sync with children problem
On Sat, Sep 02, 2000 at 12:39:30AM +0400, Egor Duda wrote:
>Hi!
>
>Saturday, 02 September, 2000 Chris Faylor cgf@cygnus.com wrote:
>
>>>i've reproduced this under gdb and see that if i call
>>>proc_can_be_signalled it won't do wait_for_me() but skip to
>
>CF> If it's not calling wait_for_me() then why is it hanging?
>
>it's not hanging, waitpid returns ECHILD
>
>CF> "simple test case" == "some minimal number of c instructions
>CF> demonstrating the behavior".
>
>ok, i'll try
I've duplicated the problem. A test case is below.
I'll look into this.
cgf
#include <stdio.h>
#include <sys/wait.h>
#include <errno.h>
int
main (int argc, char **argv)
{
int pid, n;
if ((pid = fork ()) == 0)
exit (0);
sleep (2);
if ((n = waitpid (pid, NULL, 0)) != pid)
printf ("wait pid failed, pid %d, n %d, errno %d\n", pid, n, errno);
else
printf ("wait pid succeeded, pid %d, n %d, errno %d\n", pid, n, errno);
exit (0);
}