9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Brantley Coile <brantley@coraid.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] changing close()
Date: Tue, 16 Aug 2005 13:19:56 -0400	[thread overview]
Message-ID: <dd7857fbbbca26176995c3bcb8724627@coraid.com> (raw)
In-Reply-To: <6053acc0f8905c2f30ac5d63f2450019@terzarima.net>

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

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 ½close call?

[-- Attachment #2: Type: message/rfc822, Size: 4193 bytes --]

From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] changing close()
Date: Tue, 16 Aug 2005 09:58:13 +0100
Message-ID: <6053acc0f8905c2f30ac5d63f2450019@terzarima.net>

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½clunk or Tclink).  i think one reason it wasn't much used in old BSD
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 you
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 boundaries,
so that as with 9 pipes zero isn't a special case, and it doesn't shut down any
part of the link.

oh. i see. their cat includes specific support for Unix-domain sockets (ifdef'd). what the ...
oh. i see. it's because plain open doesn't work on them and gives EOPNOTSUPP??
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 networking 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.

  reply	other threads:[~2005-08-16 17:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-15 12:06 Ronald G Minnich
2005-08-16  8:07 ` Scott Schwartz
2005-08-16 19:56   ` Charles Forsyth
2005-08-16 23:08   ` Derek Fawcus
2005-08-16  8:58 ` Charles Forsyth
2005-08-16 17:19   ` Brantley Coile [this message]
2005-08-21 20:17 ` Russ Cox
2005-08-23  8:28   ` Ronald G Minnich
2005-08-23 16:19     ` Charles Forsyth
2005-08-23  9:03       ` Ronald G Minnich
2005-08-23 16:54         ` Charles Forsyth
2005-08-27  8:02       ` kokamoto
2005-08-27  8:26         ` kokamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd7857fbbbca26176995c3bcb8724627@coraid.com \
    --to=brantley@coraid.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).