The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: lm@mcvoy.com (Larry McVoy)
Subject: [TUHS] Sockets and the true UNIX
Date: Thu, 21 Sep 2017 09:17:44 -0700	[thread overview]
Message-ID: <20170921161744.GD25650@mcvoy.com> (raw)
In-Reply-To: <201709211613.v8LGDcuN015299@darkstar.fourwinds.com>

On Thu, Sep 21, 2017 at 09:13:38AM -0700, Jon Steinhart wrote:
> Maybe this is naive of me, but I have never liked parts of the sockets
> interface.  I understand that at some level it was a political/legal
> keeping the networking code independent of the rest of the kernel.
> >From a technical and historical standpoint, I view it as the tip of
> the iceberg bloating the number of system calls.
> 
> In particular, I have often thought that it would have been a better
> and more consistent with the philosophy to have it implemented as
> open("/dev/tcp") and so on.  Granted that networking added some new
> functionality that justified some of the system calls, just not socket().

If you look in the lmbench code I sort of had similar thoughts but did
them as functions.  I've never been fond of the socket API though I
am sympathetic, it's easy to do the easy parts as /dev/tcp but as I
recall there are all sorts of weird cases that don't fit.  I've tried
to come up with a /dev/tcp style that covers all the cases and I failed.

lib_tcp.h
#include        <sys/types.h>
#include        <sys/socket.h>
#include        <netinet/in.h>
#include        <netdb.h>
#include        <arpa/inet.h>

int     tcp_server(int prog, int rdwr);
int     tcp_done(int prog);
int     tcp_accept(int sock, int rdwr);
int     tcp_connect(char *host, int prog, int rdwr);
void    sock_optimize(int sock, int rdwr);
int     sockport(int s);
#ifndef NO_PORTMAPPER
u_short pmap_getport(struct sockaddr_in *addr, u_long prognum, u_long versnum,
u_int protocol);
bool_t  pmap_set(u_long prognum, u_long versnum, u_long protocol, u_short port);
bool_t  pmap_unset(u_long prognum, u_long versnum);
#endif


  reply	other threads:[~2017-09-21 16:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 16:01 Ian Zimmerman
2017-09-21 16:07 ` Chet Ramey
2017-09-21 16:10 ` Larry McVoy
2017-09-21 16:20   ` David Edmondson
2017-09-21 16:25   ` Clem Cole
2017-09-21 16:27     ` Larry McVoy
2017-09-21 16:37     ` [TUHS] Sockets and the true UNIX [ actually carping about streams ] Jon Steinhart
2017-09-21 18:26   ` [TUHS] Sockets and the true UNIX Chet Ramey
2017-09-21 16:13 ` Jon Steinhart
2017-09-21 16:17   ` Larry McVoy [this message]
2017-09-21 20:36     ` Chris Torek
2017-09-21 18:56   ` Bakul Shah
2017-09-21 19:13     ` Steve Simon
2017-09-21 19:31       ` Bakul Shah
2017-09-21 20:15         ` ron minnich
2017-09-21 20:34           ` Clem Cole
2017-09-21 23:26   ` Dave Horsfall
     [not found] <mailman.1105.1506026200.3779.tuhs@minnie.tuhs.org>
2017-09-22 10:36 ` Paul Ruizendaal
2017-09-22 14:32   ` Clem Cole
2017-09-22 14:42     ` Chet Ramey
2017-09-22 14:47       ` Chet Ramey
2017-09-22 14:52         ` Lars Brinkhoff
2017-09-22 14:49       ` Larry McVoy
2017-09-22 14:57         ` Chet Ramey
2017-09-22 18:14           ` Chris Torek
2017-09-22 18:43             ` Clem Cole
2017-09-22 19:08             ` Chet Ramey
2017-09-22 20:57               ` Chris Torek
2017-09-24 18:04                 ` Chet Ramey
2017-09-22 18:00   ` Chris Torek
2017-09-25 17:57 Norman Wilson
2017-09-25 18:55 ` Clem Cole

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=20170921161744.GD25650@mcvoy.com \
    --to=lm@mcvoy.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).