postgresql/src/interfaces
Thomas Munro bfc9497ece libpq: Use modern socket flags, if available.
Since commit 7627b91cd5, libpq has used FD_CLOEXEC so that sockets
wouldn't be leaked to subprograms.  With enough bad luck, a
multi-threaded program might fork in between the socket() and fcntl()
calls.  We can close that tiny gap by using SOCK_CLOEXEC instead of a
separate call.  While here, we might as well do the same for
SOCK_NONBLOCK, to save another syscall.

These flags are expected to appear in the next revision of the POSIX
standard, specifically to address this problem.  Our Unixoid targets
except macOS and AIX have had them for a long time, and macOS would
hopefully use guarded availability to roll them out, so it seems enough
to use a simple ifdef test for availability until we hear otherwise.
Windows doesn't have them, but has non-inheritable sockets by default.

Discussion: https://postgr.es/m/CA%2BhUKGKb6FsAdQWcRL35KJsftv%2B9zXqQbzwkfRf1i0J2e57%2BhQ%40mail.gmail.com
2023-03-17 20:40:34 +13:00
..
ecpg pkg-config Requires.private entries should be comma-separated 2023-03-16 07:37:38 +01:00
libpq libpq: Use modern socket flags, if available. 2023-03-17 20:40:34 +13:00
Makefile Fix parallel make when running make install before make all 2011-03-08 23:52:29 +02:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00