From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 17 Aug 2005 00:08:26 +0100 From: Derek Fawcus To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] changing close() Message-ID: <20050817000826.B17788@mrwint.cisco.com> References: <43008555.4010803@lanl.gov> <20050816080704.1012.qmail@g.galapagos.bx.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20050816080704.1012.qmail@g.galapagos.bx.psu.edu>; from schwartz@bio.cse.psu.edu on Tue, Aug 16, 2005 at 04:07:04AM -0400 Topicbox-Message-UUID: 78efa4f6-ead0-11e9-9d60-3106f5b1d025 On Tue, Aug 16, 2005 at 04:07:04AM -0400, Scott Schwartz wrote: > | Is this a terrible idea? (I'm trying to address the lack of technical > | discussion mentioned an earlier note :0) > > In my humble opinion, the better solution is to have dial return > a pair of descriptors (and change the rest of the system to have > e.g. /net/tcp/9/data{0,1}), so you can close the one you want. > > But maybe it's too late for that, and changing close is the only way. I fancied having a 'split' call that would act a bit like a collision between dup and pipe; it would return 2 fds - a read only and a write only. So one could then do: int bidir_fd; int unidir_fds[2]; split(bidir_fd, unidir_fds); close(bidir_fd); /* Use unidir_fd[0] and unidir_fd[1] */ DF