The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: bakul@bitblocks.com (Bakul Shah)
Subject: [TUHS] EOF on pipes?
Date: Sun, 25 Feb 2018 15:18:59 -0800	[thread overview]
Message-ID: <20180225231914.542B1156E812@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Sun, 25 Feb 2018 14:25:51 -0800." <alpine.BSF.2.21.1802251422190.96837@orthanc.ca>

On Sun, 25 Feb 2018 14:25:51 -0800 Lyndon Nerenberg <lyndon at orthanc.ca> wrote:
Lyndon Nerenberg writes:
> > If a stream was marked as using delimeters (and pipes always
> > were), a delimeter was inserted after every write(2).  So
> > write(2) generated an empty message, and read(2) returned it.
> 
> And this lived on in the IL network protocol. I've always thought that was 
> one of the more elegant aspects of IL, but of course it didn't have a hope 
> in hell of surviving outside the Plan 9 ecosystem.

BSD networking has had sequenced packet protocol (SPP) support
pretty much from the beginning (probably due to early XNS
influence).  From socket(2):

     SOCK_SEQPACKET sockets employ the same system calls as SOCK_STREAM
     sockets.  The only difference is that read(2) calls will return only the
     amount of data requested, and any remaining in the arriving packet will
     be discarded.

Even today you can do

    int fd = socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);

Presumably read(fd, ptr, 0) works too.


  reply	other threads:[~2018-02-25 23:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-25  0:53 Norman Wilson
2018-02-25 16:29 ` Paul Winalski
2018-02-25 22:25 ` Lyndon Nerenberg
2018-02-25 23:18   ` Bakul Shah [this message]
2018-02-26  2:39   ` Grant Taylor
  -- strict thread matches above, loose matches on Subject: below --
2018-02-27  5:04 Rudi Blom
2018-02-27  5:48 ` Dave Horsfall
2018-02-25 13:07 Doug McIlroy
2018-02-25 13:16 ` George Michaelson
2018-02-25 13:56   ` arnold
2018-02-24 21:33 Dave Horsfall
2018-02-24 23:13 ` Ron Natalie
2018-02-24 23:42   ` Bakul Shah
2018-02-24 23:46     ` Nelson H. F. Beebe
2018-02-24 23:46     ` Jon Steinhart
2018-02-26 16:03 ` Rudi Blom
2018-02-26 16:58   ` Ian Zimmerman
2018-02-26 17:19     ` Larry McVoy

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=20180225231914.542B1156E812@mail.bitblocks.com \
    --to=bakul@bitblocks.com \
    /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).