Re: Cleaning up historical portability baggage - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Cleaning up historical portability baggage
Date
Msg-id CA+hUKGLW6dWAJYQ4q1wXED78L_=tZp0LKi-BNjEaEnqfyWB4vw@mail.gmail.com
Whole thread Raw
In response to Re: Cleaning up historical portability baggage  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: Cleaning up historical portability baggage
Re: Cleaning up historical portability baggage
List pgsql-hackers
On Fri, Aug 12, 2022 at 8:03 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Fri, Aug 12, 2022 at 7:15 PM Peter Eisentraut
> <peter.eisentraut@enterprisedb.com> wrote:
> > But maybe it would be better to make that a separate patch from the
> > sys/un.h configure changes, just so there is more clarity around it.
>
> Cool, I'll do that.

I pushed these, except I chopped out the HAVE_UNIX_SOCKETS part as
requested.  Here it is in a separate patch, with a commit message that
explains the rationale (essentially, what you said, it's basically a
runtime matter for a hypothetical AF_UNIX-less system to complain
about).  Tom, does this argument persuade you?  Also, a couple of
nearby things:

  Remove HAVE_UNIX_SOCKETS.
  Remove configure probe for struct sockaddr_storage.
  Remove configure probe for getaddrinfo, and replacement code.

If I'm reading comments and scraped configure data right, it looks
like those last two things were there only for HP-UX 10 and Windows <
8.1.

I tried to figure out how to get rid of
PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS, but there we're into genuine
non-standard cross-platform differences.  At best maybe you could
maybe skip the test for ss_family (POSIX says you have to have that,
but I haven't read RFC 2553 to see why it claims someone should spell
it differently).  Didn't seem worth changing.

bfbot=> select name, value, count(*) from macro where name like
'%SOCKADDR_%' group by 1, 2;
                  name                  | value | count
----------------------------------------+-------+-------
 HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN    | 1     |    13 <-- BSDish
 HAVE_STRUCT_SOCKADDR_STORAGE           | 1     |   108 <-- everyone
 HAVE_STRUCT_SOCKADDR_SA_LEN            | 1     |    18 <-- BSDish + AIX
 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY | 1     |   108 <-- everyone
 HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN  | 1     |     5 <-- AIX
 HAVE_STRUCT_SOCKADDR_UN                | 1     |   106 <-- everyone
except mingw
(6 rows)

Attachment

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Add lasterrno setting for dir_existsfile()
Next
From: Thomas Munro
Date:
Subject: Re: Cleaning up historical portability baggage