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

Ben Millwood haskell at benmachine.co.uk
Sun Apr 28 21:30:19 CEST 2013


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.

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. I'm not an expert though!

-- Ben



More information about the Libraries mailing list