Re: Cleaning up historical portability baggage

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cleaning up historical portability baggage
Date: 2022-08-19 05:54:56
Message-ID: CA+hUKGJJjF2AqdU_Aug5n2MAc1gr=GykNjVBZq+d6Jrcp3Dyvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 14, 2022 at 6:07 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> > 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.
>
> Right. I don't think it's worth sweating over.

I managed to get rid of four of these probes. Some were unused, and
one could be consolidated into another leaving just one probe of this
ilk.

1. src/common/ip.c already made a leap by assuming that if you have
ss_len then you must have sun_len. We might as well change that to be
driven by the presence of sa_len instead. That leap is fine: if you
have one, you have them all, and sa_len has the advantage of a stable
name across systems that have it (unlike ss_len, which AIX calls
__ss_len, requiring more configure gloop).

2. src/backend/libpq/ifaddr.c only needs to know if you have sa_len.
This code is only used on AIX, so we could hard-wire it in theory, but
it's good to keep it general so you can still compile and test it on
systems without sa_len (mostly Linux).

Attachment Content-Type Size
0001-Remove-configure-probes-for-sockaddr_storage-members.patch text/x-patch 6.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2022-08-19 05:56:43 Re: static libpq (and other libraries) overwritten on aix
Previous Message Peter Smith 2022-08-19 05:22:50 Re: Perform streaming logical transactions by background workers and parallel apply