Volker Stolz wrote:

> In local.glasgow-haskell-bugs, you wrote:
> > Am 10. Jul 2002 um 22:21 CEST schrieb Dean Herington:
> >> The first issue I confronted is that the get*ProcessStatus routines return
> >> an error rather than "nothing" if there is no candidate child process.
> >
> > Yes, `waitpid' might return with EINTR which will cause an exception
> > (I just checked, it did). I'll try to devise a fix for PosixProcPrim.
>
> That's ECHILD, not EINTR.

Yes, that's what I would expect from reading the man page.

I was not complaining about the Unix semantics, just noting that there was a
subtlety I wasn't previously aware of that made my code more complex.

> The only nice way to figure this out might be keeping a global counter
> (in an MVar), increasing it on forkProcess() and counting it down for
> each "awaited" child. That way, you could safely loop on `waitpid' if
> you know there should still be a child around (and you'll get `Nothing'
> if it's not done yet).

Yes, that's exactly the solution I came up with.

> Volker

Thanks.

Dean

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to