[jhc] darcs patch: add System.IO.Pipe.

John Meacham john at repetae.net
Sun Sep 20 19:01:59 EDT 2009


On Sun, Sep 20, 2009 at 06:26:30PM -0400, David Roundy wrote:
> This patch adds support for popen/pclose.  It's a bit hokey, and
> doesn't quite work right.  In particular, I get an error if I try to
> use getErrno in openPipe.  gcc complains about errno not being
> defined, because errno.h isn't included.  For the moment, openPipe
> just doesn't check for errors, but that isn't a great long-term
> solution.

errno.h is ISO C, so we can include it in src/data/rts/jhc_rts_header.h
without issue. 

> So far as I can discern, this is portable code, at least to mingw,
> which is as far into windows as I care to venture.

cool. I should modify the regressions to test with mingw/wine when they
are available actually.

> 
> P.S.  I'd much rather have System.Process ported, but gave up on doing
> this myself after realizing that I'd have to implement much of
> GHC.Handle in order to do this, since we'd have to work with file
> descriptors rather than FILE *.  :(

Is this true? can't we just use fdopen(3) to turn the descriptors into
handles?

        John


-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the jhc mailing list