Bug with readFile and named pipes
Simon Marlow
simonmar at microsoft.com
Fri Aug 24 04:52:49 EDT 2001
> Simon Marlow wrote:
>
> >>There was a long thread about this a while back (subject
> "Blocking I/O
> >>and FIFOs").
> >>
> I didn't find it in the archives...
Try here:
http://www.mail-archive.com/glasgow-haskell-bugs@haskell.org/msg03235.ht
ml
unfortunately the archives at haskell.org aren't easily searchable.
> >> The conclusion was that the behaviour varies between OSs:
> >>the behaviour Thomas described occurs on FreeBSD, but not Linux or
> >>Solaris. POSIX appears to be ambiguous on the subject.
> >>
> I forgot to say that I tested my program on SunOS 5.7 (GHC 4.08 and
> 5.00.1), Linux 2.2 (GHC 5.00) and Linux 2.4 (GHC 5.00.2), and the
> problem occurs in all cases. What is it that only occurs on FreeBSD?
I was slightly incorrect. Your example fails on everything, but one of
the workarounds works on everything but FreeBSD (the workaround is to do
threadWaitRead on the FD of the FIFO before reading from it, this is
supposed to wait for the writer to arrive). The other workaround,
namely opening it for writing yourself, works on everything.
I've put an entry in the FAQ for the next release.
Cheers,
Simon
More information about the Glasgow-haskell-bugs
mailing list