Re: sockaddr_un.sun_len vs. reality - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: sockaddr_un.sun_len vs. reality
Date
Msg-id CA+hUKGKjxvxwC6W+PBH=FTsmOiej27neH+JbYVV6zYeoJMWUvA@mail.gmail.com
Whole thread Raw
In response to Re: sockaddr_un.sun_len vs. reality  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Aug 23, 2022 at 3:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@gmail.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 ...".



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: SQL/JSON features for v15
Next
From: Robert Haas
Date:
Subject: Re: Inconsistencies around defining FRONTEND