bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run.c translator


From: Marcus Brinkmann
Subject: Re: run.c translator
Date: Wed, 20 Mar 2002 15:40:02 -0500
User-agent: Mutt/1.3.25i

On Tue, Mar 19, 2002 at 02:54:24PM -0800, Thomas Bushnell, BSG wrote:
> I'm baffled.  If it's a plain pipe, then you simply close the end
> you're writing on, and the reader gets EOF.
> 
> I assumed the implementation used socketpairs, where closing your
> writing half would prevent you from also reading on it.

The implementation is using the Hurd's IO interface.  It seems I was not
clear enough in my original mail.  The translator creates a pipe to the
forked program, and translates io_read into a pipe read and io_write
into a pipe write.  The translator forks for every open().

Now, suppose you have a program like wc that collects data and returns
a summary of that data.  It will read from stdin until it gets EOF, and
then print from stdout.  But if I use the above translator, I have only
one filedescriptor, and I cannot simply close it if I want to read back
the summary of wc.  So how do I inform the translator that it should
close the pipe the forked program reads from (it can easily use two
pipes instead one bidirectional one, but the program holding a port to
the translator can not easily get two ports, one for the reads and one
for the writes).

Thanks
Marcus




reply via email to

[Prev in Thread] Current Thread [Next in Thread]