[Top][All Lists]

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

Re: run.c translator

From: Thomas Bushnell, BSG
Subject: Re: run.c translator
Date: 20 Mar 2002 12:55:36 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Marcus Brinkmann <marcus@gnu.org> writes:

> 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().

Everything that uses the IO interface is either a file or a socket.  

> 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.  

Then you are using a bidirectional pipe: you should really call it a
socketpair.  (Exactly how are you creating it?)

This is what the shutdown call is for.  You shutdown for writing,
which is like closing one half of the pipe.  The guy reading on the
other end will get EOF, but the other half of the pipe will be just


reply via email to

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