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: 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-07-23 22:39:27
Message-ID: CA+hUKG+MOzmDkr27ceG8+uwgFxbJUUv699V3VP3DCioQigrf7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have committed the first few:

* "Remove dead getrusage replacement code."
* "Remove dead handling for pre-POSIX sigwait()."
* "Remove dead getpwuid_r replacement code."

Here are some more, a couple of which I posted before but I've now
gone a bit further with them in terms of removing configure checks
etc:

* "Remove dlopen configure probe."
* "Remove configure probe and extra tests for getrlimit."
* "Remove configure probe for shm_open."
* "Remove configure probe for setsid."
* "Remove configure probes for readlink, and dead code and docs."
* "Remove configure probe for symlink, and dead code."
* "Remove configure probe for link."
* "Remove dead replacement code for clock_gettime()."
* "Remove configure probes for poll and poll.h."
* "Remove dead setenv, unsetenv replacement code."
* "Remove dead pread and pwrite replacement code."
* "Simplify replacement code for preadv and pwritev."
* "Remove --disable-thread-safety."

Some of these depend on SUSv2 options (not just "base"), but we
already do that (fsync, ...) and they're all features that are by now
ubiquitous, which means the fallback code is untested and the probes
are pointless.

<archeology-mode>I'd guess the last system we ran on that didn't have
symlinks would have been SVr3-based SCO, HP-UX, DG/UX etc from the
1980s, since they were invented in 4.2BSD in 1983 and adopted by SVr4
in 1988. The RLIMIT_OFILE stuff seems to be referring to 1BSD or 2BSD
on a PDP, whereas RLIMIT_NOFILE was already used in 4.3BSD in 1986,
which I'd have guessed would be the oldest OS POSTGRES ever actually
ran on, so that must have been cargo culting from something older?</>

The clock_gettime() one only becomes committable once prairiedog's
host switched to NetBSD, so that'll be committed at the same time as
the fdatasync one from a nearby thread.

The setenv/unsetenv one levels up to SUSv3 (= POSIX issue 6, 2001).
That'd be the first time we don't point at SUSv2 (= POSIX issue 5,
199x) to justify a change like this.

I expect there to be further clean-up after the removal of
--disable-thread-safety.

Attachment Content-Type Size
0001-Remove-dlopen-configure-probe.patch text/x-patch 4.7 KB
0002-Remove-configure-probe-and-extra-tests-for-getrlimit.patch text/x-patch 8.2 KB
0003-Remove-configure-probe-for-shm_open.patch text/x-patch 3.8 KB
0004-Remove-configure-probe-for-setsid.patch text/x-patch 6.3 KB
0005-Remove-configure-probes-for-readlink-and-dead-code-a.patch text/x-patch 8.2 KB
0006-Remove-configure-probe-for-symlink-and-dead-code.patch text/x-patch 7.7 KB
0007-Remove-configure-probe-for-link.patch text/x-patch 3.5 KB
0008-Remove-dead-replacement-code-for-clock_gettime.patch text/x-patch 5.0 KB
0009-Remove-configure-probes-for-poll-and-poll.h.patch text/x-patch 6.7 KB
0010-Remove-dead-setenv-unsetenv-replacement-code.patch text/x-patch 9.0 KB
0011-Remove-dead-pread-and-pwrite-replacement-code.patch text/x-patch 20.6 KB
0012-Simplify-replacement-code-for-preadv-and-pwritev.patch text/x-patch 7.8 KB
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 Tom Lane 2022-07-23 23:11:12 Re: Cleaning up historical portability baggage
Previous Message Tom Lane 2022-07-23 17:42:56 PSA for folks forwarding personal email domains to Gmail