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: Andrew Dunstan <andrew(at)dunslane(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, 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-03 02:25:01
Message-ID: CA+hUKGJMcwbzRyfTocfxbPBUhERqKE42d-L22jQ+vpB7an-NjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry, I know this is really tedious stuff, but I found a couple more
cleanup opportunities nearby:

For dlopen(), we don't have to worry about old Unix systems without
RTLD_NOW and RTLD_GLOBAL macros anymore. They're in SUSv2 and present
on all our BF Unixes, so that's some more configure probes that we can
remove. Also, we might as well move the declarations for everything
relating to dlopen into win32_port.h.

(Why some WIN32 things are done in port.h while others are done in
win32_port.h is something I don't grok; probably depends whether there
were ever non-Windows systems that needed something... I might propose
to tidy that up some more, later...)

For setenv()/unsetenv(), I removed the declarations from port.h. Only
the ones in win32_port.h are needed now.

I fixed a couple of places where I'd renamed a file but forgotten to
update that IDENTIFICATION section from the CVS days, and a stray 2021
copyright year.

It'd be good to find a new home for pg_get_user_name() and
pg_get_user_home_dir(), which really shouldn't be left in the now
bogusly named src/port/thread.c. Any suggestions?

Was it a mistake to add pgwin32_ prefixes to some Windows replacement
functions? It seems a little arbitrary that we do that sometimes even
though we don't need to. Perhaps we should only do that kind of thing
when we want to avoid name-clash with a real Windows function that
we're replacing?

I'd like to push these soon, if there are no further objections. If
you prefer, I could hold back on the two that will break prairiedog
until you give the word, namely clock_gettime() and fdatasync().

Attachment Content-Type Size
v3-0001-Remove-configure-probe-for-dlopen.patch text/x-patch 9.4 KB
v3-0002-Remove-configure-probe-and-extra-tests-for-getrli.patch text/x-patch 8.2 KB
v3-0003-Remove-configure-probe-for-shm_open.patch text/x-patch 3.3 KB
v3-0004-Remove-configure-probe-for-setsid.patch text/x-patch 3.3 KB
v3-0005-Remove-configure-probes-for-symlink-readlink-and-.patch text/x-patch 13.4 KB
v3-0006-Remove-configure-probe-for-link.patch text/x-patch 5.5 KB
v3-0007-Remove-dead-replacement-code-for-clock_gettime.patch text/x-patch 5.3 KB
v3-0008-Remove-configure-probes-for-poll-and-poll.h.patch text/x-patch 4.4 KB
v3-0009-Remove-dead-setenv-unsetenv-replacement-code.patch text/x-patch 9.4 KB
v3-0010-Remove-dead-pread-and-pwrite-replacement-code.patch text/x-patch 22.6 KB
v3-0011-Simplify-replacement-code-for-preadv-and-pwritev.patch text/x-patch 8.8 KB
v3-0012-Remove-fdatasync-configure-probe.patch text/x-patch 12.0 KB
v3-0013-Remove-disable-thread-safety.patch text/x-patch 62.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2022-08-03 02:46:47 Re: Parallel Aggregates for string_agg and array_agg
Previous Message Kyotaro Horiguchi 2022-08-03 02:24:17 Re: Race between KeepFileRestoredFromArchive() and restartpoint