From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <84ee8e0fc6f0318c80b7e464cbde5c95@plan9.bell-labs.com> From: "Russ Cox" To: 9fans@cse.psu.edu Subject: Re: [9fans] bidirectional pipes MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 2 May 2002 18:30:29 -0400 Topicbox-Message-UUID: 85dab828-eaca-11e9-9e20-41e7f4b1d025 > | I'm curious? Why does this bother you? Just let half the connection > | go unused. > > I think that having two open fds is nicer than one open fd and some extra > system calls, because it's impossible to get it wrong. Plan 9 doesn't > have a way to do half-close at all, right? So what if your server was > "sort" instead of "ssh"? Then you can set it up with a different pipe for input and for output, and then close the input pipe. Problem solved. This is what rc does by default. The <[0=1] explicitly worked around this. If you'd rather have one fd and don't need the half-open nonsense, you can use the same pipe for both. The only real difference is that if you try to write to a pipe that it only makes sense to read from, you won't notice when the pipe is bidirectional. Russ