Re: Cleaning up historical portability baggage
Michael Banck <mbanck@gmx.net>
Hi Thomas, On Thu, Aug 11, 2022 at 10:02:29PM +1200, Thomas Munro wrote: > Remove configure probe for sys/uio.h. Removing the configure probe is fine, but the patch also changes behavior in the sense that IOV_MAX is now considered defined everywhere but on Windows. However, in the good-old GNU "we have no arbitrary limits" fashion, this breaks on GNU Hurd: |gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshado |w=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -DFRONTEND -I. -I../../src/common - |I../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-D_GNU_SOURCE -I/usr/include/libxml2\"" -DVAL_CFLAGS="\"-Wall -Wmissing-prototypes -Wpoin |ter-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security |-fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2\"" -DVAL_CFLAGS_SL="\"-fPIC\"" -DVAL_LDFLAGS="\"-Wl,--as-needed -Wl,-rpa |th,'/home/demo/build-farm-19.1/buildroot/REL_16_STABLE/inst/lib',--enable-new-dtags\"" -DVAL_LDFLAGS_EX="\"\"" -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgcommon -lpgport -lxslt -lxml2 - |lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lpthread -lm \"" -c -o file_utils.o file_utils.c |In file included from ../../src/include/postgres_fe.h:25, | from file_utils.c:19: |file_utils.c: In function 'pg_pwritev_with_retry': |../../src/include/port/pg_iovec.h:36:24: error: 'IOV_MAX' undeclared (first use in this function); did you mean 'INT_MAX'? | 36 | #define PG_IOV_MAX Min(IOV_MAX, 32) | | ^~~~~~~ |../../src/include/c.h:988:35: note: in definition of macro 'Min' | 988 | #define Min(x, y) ((x) < (y) ? (x) : (y)) | | ^ |file_utils.c:474:31: note: in expansion of macro 'PG_IOV_MAX' | 474 | struct iovec iov_copy[PG_IOV_MAX]; | | ^~~~~~~~~~ |../../src/include/port/pg_iovec.h:36:24: note: each undeclared identifier is reported only once for each function it appears in |$ grep IOV_MAX /usr/include/i386-gnu/bits/uio_lim.h |#undef __IOV_MAX Postgres built fine up and until v15 on the Hurd, so this is a build regression, and the fact that we define #PG_IOV_MAX to at most 32 anyway suggest we could just #definde IOV_MAX to 16 if undefined as on Windows. Christoph fixed this up for Debian's hurd-i386 builds in https://salsa.debian.org/postgresql/postgresql/-/commit/641713a4585e4b040266a1fa567b7ec90469a1bb but I have not seen a discussion about this (but might have missed it), so bringing it up here for upstream consideration in v16 and newer. Michael
Commits
-
Make sure IOV_MAX is defined.
- d25d392e8944 16.10 landed
- 581305a4659d 18.0 landed
- 1fd772d19290 19 (unreleased) landed
- 0991249d7ab5 17.6 landed
-
Doc: Abstract AF_UNIX sockets don't work on Windows.
- 36c910f03783 14.7 landed
- d54e1fcaa5f2 15.2 landed
- 117d2604c2a5 16.0 landed
-
Clean up inconsistent use of fflush().
- 7fed801135ba 16.0 landed
-
Remove configure probe for sockaddr_in6 and require AF_INET6.
- bcc8b14ef630 16.0 landed
-
Remove configure probes for sockaddr_storage members.
- 64ef572c068f 16.0 landed
-
Remove configure probe for netinet/tcp.h.
- 2492fe49dcb5 16.0 landed
-
Fix macro problem with gai_strerror on Windows.
- cce28f62680c 16.0 landed
-
Remove configure probe for net/if.h.
- 2f8d918359cc 16.0 landed
-
mstcpip.h is not missing on MinGW.
- f340f97a13b1 16.0 landed
-
Remove dead ifaddr.c fallback code.
- a717cddcac51 16.0 landed
-
Remove configure probe for gethostbyname_r.
- 52ea29045b79 16.0 landed
-
Remove replacement code for getaddrinfo.
- 5579388d2dda 16.0 landed
-
Remove configure probe for struct sockaddr_storage.
- de42bc3ac8f7 16.0 landed
-
Remove HAVE_UNIX_SOCKETS.
- f55808828569 16.0 landed
-
Remove configurability of PPC spinlock assembly code.
- 8ded65682bee 16.0 landed
-
Remove configure probe for shl_load library.
- adee0df127e0 16.0 landed
-
Remove configure probe for sys/select.h.
- 7e50b4e3c52a 16.0 landed
-
Remove configure probes for sys/un.h and struct sockaddr_un.
- 077bf2f27500 16.0 landed
-
Remove configure probes for sys/ipc.h, sys/sem.h, sys/shm.h.
- 37a65d1db146 16.0 landed
-
Remove configure probe for sys/resource.h and refactor.
- 36b3d52459ae 16.0 landed
-
Remove configure probe for sys/uio.h.
- 75357ab94034 16.0 landed
-
Fix obsolete comments in instr_time.h.
- 01126dc8cf2c 16.0 landed
-
aix: fix misreading of condition in 8f12a4e7add
- 7e29a79a46d3 16.0 landed
-
aix: Remove checks for very old OS versions
- 8f12a4e7addc 16.0 landed
-
windows: Remove HAVE_MINIDUMP_TYPE test
- 9ddb870bd479 16.0 landed
-
solaris: Remove unnecessary gcc / gnu ld vs sun studio differences
- 20c105c4db56 16.0 landed
-
Trust a few system headers to stand on their own
- a2a36d56b96f 16.0 landed
-
Rely on __func__ being supported
- 320f92b744b4 16.0 landed
-
Simplify replacement code for strtof.
- cbf440313473 16.0 landed
-
Simplify gettimeofday for Windows.
- 24c3ce8f1c70 16.0 landed
-
Simplify gettimeofday() fallback logic.
- 922a8fa09840 16.0 landed
-
Remove fallbacks for strtoll, strtoull.
- feb593506b9b 16.0 landed
-
Remove configure probe for fdatasync.
- d2e150831af8 16.0 landed
-
Remove configure probe for clock_gettime.
- 623cc67347cc 16.0 landed
-
Simplify replacement code for preadv and pwritev.
- a0dc82711221 16.0 landed
-
Remove dead pread and pwrite replacement code.
- cf112c122060 16.0 landed
-
Remove dead setenv, unsetenv replacement code.
- 71f5dc6dfb3d 16.0 landed
-
Remove configure probes for poll and poll.h.
- b79ec732d29f 16.0 landed
-
Remove configure probe for link.
- 5963c9a154bd 16.0 landed
-
Remove configure probes for symlink/readlink, and dead code.
- 2b1f580ee2ca 16.0 landed
-
Remove configure probe for setsid.
- adeef67834cc 16.0 landed
-
Remove configure probe for shm_open.
- 098f4d813b69 16.0 landed
-
Remove configure probe and related tests for getrlimit.
- bdb657edd6db 16.0 landed
-
Remove configure probe for dlopen, and refactor.
- ca1e85513e1c 16.0 landed
-
Remove dead getpwuid_r replacement code.
- e757cdd6ad1b 16.0 landed
-
Remove dead handling for pre-POSIX sigwait().
- fb12becdfb89 16.0 landed
-
Remove dead getrusage replacement code.
- 86e5eb4f58a2 16.0 landed
-
Cygwin and Mingw floating-point fixes.
- 72880ac182c8 12.0 cited
-
Support platforms where strtoll/strtoull are spelled __strtoll/__strtoull.
- 06f66cff9e0b 11.0 cited
-
Arrange to supply declarations for strtoll/strtoull if needed.
- a6228128fc48 11.0 cited
-
Lock down regression testing temporary clusters on Windows.
- f6dc6dd5ba54 9.5.0 cited
-
Secure Unix-domain sockets of "make check" temporary clusters.
- be76a6d39e28 9.5.0 cited
-
Add configure checks for strtoll, strtoull (or strto[u]q). Disable
- 9394d391b803 7.1.1 cited
-
Portability fix for old SunOS releases: fflush(NULL)
- 79fcde48b229 7.1.1 cited