Re: sockaddr_un.sun_len vs. reality

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: sockaddr_un.sun_len vs. reality
Date: 2022-08-23 22:53:52
Message-ID: CA+hUKGKjxvxwC6W+PBH=FTsmOiej27neH+JbYVV6zYeoJMWUvA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 23, 2022 at 3:43 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> > I was nerd-sniped by the historical context of this single line of
> > code. I'd already wondered many times (not just in PostgreSQL)
> > whether and when that became a cargo-cult practice, replicated from
> > other software and older books like Stevens. I failed to find any
> > sign of an OS that needs it today, or likely even needed it this
> > millennium. Now I'd like to propose removing it.
>
> Seems worth a try.

Pushed, and build farm looks good. For the benefit of anyone else
researching this topic, I should add that Stevens in fact said it's OK
to skip this, and if I had opened UNIX Network Programming (3rd ed)
volume I to page 99 I could have saved myself some time: "Even if the
length field is present, we need never set it and need never examine
it, unless we are dealing with routing sockets ...".

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-08-23 22:58:50 Re: Inconsistencies around defining FRONTEND
Previous Message Andrew Dunstan 2022-08-23 22:12:49 Re: SQL/JSON features for v15