summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-03-17 17:08:02 +1300
committerThomas Munro <tmunro@postgresql.org>2023-03-17 20:40:34 +1300
commitbfc9497ece01c7c45437bc36387cb1ebe346f4d2 (patch)
treec497f686beb80b9aab5df68dcab6903f7ce57d65 /src/backend/access/gist/gist.c
parent95a828378ed243a1b37cab6bda99746bfc0af509 (diff)
downloadpostgresql-bfc9497ece01c7c45437bc36387cb1ebe346f4d2.tar.gz
libpq: Use modern socket flags, if available.
Since commit 7627b91cd5d, 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
Diffstat (limited to 'src/backend/access/gist/gist.c')
0 files changed, 0 insertions, 0 deletions