Portability fixes for sigwait.

Thomas Munro <tmunro@postgresql.org>

Commit: 5865e064abfbbe11ebfc09881be009c0f69b4dc2
Author: Thomas Munro <tmunro@postgresql.org>
Date: 2021-07-15T00:34:31Z
Releases: 15.0
Portability fixes for sigwait.

Build farm animals running ancient HPUX and Solaris have a non-standard
sigwait() from draft versions of POSIX, so they didn't like commit
7c09d279.  To avoid the problem in general, only try to use sigwait() if
it's declared by <signal.h> and matches the expected declaration.  To
select the modern declaration on Solaris (even in non-threaded
programs), move -D_POSIX_PTHREAD_SEMANTICS into the right place to
affect all translation units.

Also fix the error checking.  Modern sigwait() doesn't set errno.

Thanks to Tom Lane for help with this.

Discussion: https://postgr.es/m/3187588.1626136248%40sss.pgh.pa.us

Files

PathChange+/−
config/thread_test.c modified +0 −4
configure modified +69 −6
configure.ac modified +35 −3
src/bin/psql/command.c modified +7 −6
src/bin/psql/startup.c modified +2 −2
src/include/pg_config.h.in modified +7 −0
src/tools/msvc/Solution.pm modified +2 −0

Discussion

Cited messages not in the archive: 3187588.1626136248@sss.pgh.pa.us