Proposal: When possible, give more useful exceptions from rawSystem and friends

Ian Lynagh ian at well-typed.com
Tue May 7 12:18:56 CEST 2013


On Sun, Apr 28, 2013 at 08:30:19PM +0100, Ben Millwood wrote:
> On Sun, Apr 28, 2013 at 02:36:24PM +0100, Ian Lynagh wrote:
> >However, if we are on a platform that supports vfork, then we can pass
> >information from the child process back to the parent process as they
> >share address space.
> 
> AIUI the POSIX standard at least does not guarantee this behaviour –
> it's perfectly OK in theory for vfork to be equal to fork, and more
> generally the behaviour of a vfork which edits its parent's memory
> is seemingly unspecified. I don't know if Linux provides more
> guarantees than that, but if we're relying on nonstandard behaviour
> this fact should be at least commented.

We don't actually rely on it: If it doesn't work then programs just get
less helpful error messages. But we'd still like it to work as often as
possible.

> I think the "right" way to do this is creating a pipe() beforehand
> and then using conventional-fork, and writing to the pipe if
> anything goes wrong.

Aha, thanks. I'll look into this.


Thanks
Ian
-- 
Ian Lynagh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/




More information about the Libraries mailing list