From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] changing close() From: Brantley Coile Date: Tue, 16 Aug 2005 13:19:56 -0400 In-Reply-To: <6053acc0f8905c2f30ac5d63f2450019@terzarima.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-nvvfmpezkdfogirofyafpiybmm" Topicbox-Message-UUID: 78e36416-ead0-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-nvvfmpezkdfogirofyafpiybmm Content-Disposition: inline Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable In my version of Unix 7th Edition years ago I added another svc call to half close anything. It was a no-op on most files. I like the Tclink idea. What about a =C2=BDclose call? --upas-nvvfmpezkdfogirofyafpiybmm Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by coraid.com; Tue Aug 16 04:58:34 EDT 2005 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 8284F18D88 for ; Tue, 16 Aug 2005 04:58:30 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 1B83F182EA for <9fans@cse.psu.edu>; Tue, 16 Aug 2005 04:58:14 -0400 (EDT) Received: from mail.cse.psu.edu ([127.0.0.1]) by localhost (psuvax1 [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04361-01-95 for <9fans@cse.psu.edu>; Tue, 16 Aug 2005 04:58:11 -0400 (EDT) Received: from lavoro.terzarima.net (spc1-york1-5-0-cust142.seac.broadband.ntl.com [80.0.45.142]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id EF85A181EC for <9fans@cse.psu.edu>; Tue, 16 Aug 2005 04:58:09 -0400 (EDT) Message-ID: <6053acc0f8905c2f30ac5d63f2450019@terzarima.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] changing close() From: Charles Forsyth Date: Tue, 16 Aug 2005 09:58:13 +0100 In-Reply-To: <43008555.4010803@lanl.gov> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Virus-Scanned: by amavisd-new at cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+brantley=coraid.com@cse.psu.edu Errors-To: 9fans-bounces+brantley=coraid.com@cse.psu.edu Content-Transfer-Encoding: quoted-printable i wonder if it is common enough to want to change not only close but 9P (Tclunk would presumably change, or another message added such as T=C2=BDclunk or Tclink). i think one reason it wasn't much used in old B= SD is that most TCP/IP protocols have an application handshake at the end, two exceptions being now-deprecated BSD protocols. on the other hand, i grep and see that new BSD manages to use it in cat(!), and why not, and there are other uses, but only a few could be considered essential (mainly for those tcp/ip protocols i mentioned). inessential ones include a few preventing one part of the program from reading messages written by another part. still, that's not to say close-write hasn't got some merit if otherwise y= ou can't do something important, but if its use is generally specific to particular protocols (applications), one might add a control message to ip/tcp.c with some consequential coding. in fact, it has "hangup" but that seems to assume that RST sent implies no further data can be received, which might not be right anyway. perhaps just changing that would do. of course, i'm making the assumption that the application must know these low-level properties, because application protocol assumes the network has them, so it won't work on just any type of connection. it isn't quite the same as with IL/IP because it just transmits write bou= ndaries, so that as with 9 pipes zero isn't a special case, and it doesn't shut do= wn any part of the link. oh. i see. their cat includes specific support for Unix-domain sockets (i= fdef'd). what the ... oh. i see. it's because plain open doesn't work on them and gives EOPNOTS= UPP?? not-quite-unix domain sockets? and there are two shutdown calls but only one is ever called, on a read-only file, which reduces it to close. i wondered if some of the other calls i saw are there because a networkin= g book says to use shutdown. i saw shutdown(fd, 0); shutdown(fd, 1); ok, ok. sometimes there are ifdef's and conditionals round some of those,= but still. --upas-nvvfmpezkdfogirofyafpiybmm--