nick at ccl4.org
Thu Oct 25 08:38:18 PDT 2001
On Thu, Oct 25, 2001 at 05:05:27PM +0200, Stefan Bellon wrote:
> Nicholas Clark <nick at ccl4.org> wrote:
> > Use two pipes, one for each direction?
> Yes, of course, this would work.
> But then I misunderstood the description of pipe() in the Single UNIX
> Specification Version 2:
> "Data can be written to the file descriptor fildes and read from
> file descriptor fildes. A read on the file descriptor fildes
> will access data written to file descriptor fildes on a
> first-in-first-out basis. [...]"
I think this description is for a bi-directional pipe.
> >From this I concluded that when reading from fildes once, the same
> content can't be read again when reading another time from fildes
> regardless of whether this happens in the same process or in the parent
> Am I wrong in concluding this from the above quoted description?
Your conclusion is correct (I think).
However, unixlib is only implementing single direction pipes,
(and probably buggily. This seems to ring a bell. I guess that there should
be an error on writing to the read end)
More information about the gcc