on 10/02/2010 19:52 Garrett Cooper said the following:
>     Isn't this section of the system(3) libcall essentially doing what
> you want, s.t. you'll never be able to get the process status when you
> call waitpid(2)?
> 
>        do {
>            pid = _wait4(savedpid, &pstat, 0, (struct rusage *)0);
>        } while (pid == -1 && errno == EINTR);
>        break;
> 
>     You typically get status via wait*(2) when using exec*(2) or via
> the return codes from system(3), not system(3) with wait*(2)...

Exactly.  I think that SIGCHLD handler would effectively 'reap' the child and 
thus
wait*() in system would rightfully return ECHILD (perhaps after doing EINTR
iteration of the loop).

-- 
Andriy Gapon
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to