diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-02-09 14:24:54 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-02-09 14:24:54 -0500 |
commit | c5f5b4dd4b5ccecd193550530ff483f16f95746b (patch) | |
tree | 01fe041061884828a3148991e1e5abe32c7ce8a6 | |
parent | f48385c1327f1eaef134ad41b382041a79c5200a (diff) | |
download | postgresql-c5f5b4dd4b5ccecd193550530ff483f16f95746b.tar.gz postgresql-c5f5b4dd4b5ccecd193550530ff483f16f95746b.zip |
Test honestly for <sys/signalfd.h>.
Commit 6a2a70a02 supposed that any platform having <sys/epoll.h>
would also have <sys/signalfd.h>. It turns out there are still a
few people using platforms where that's not so, so we'd better make
a separate configure probe for it. But since it took this long to
notice, I'm content with the decision to not have a separate code
path for epoll-only machines; we'll just fall back to using poll()
for these stragglers.
Per gripe from Gabriela Serventi. Back-patch to v14 where this
code came in.
Discussion: https://postgr.es/m/CAHOHWE-JjJDfcYuLAAEO7Jk07atFAU47z8TzHzg71gbC0aMy=g@mail.gmail.com
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/backend/storage/ipc/latch.c | 9 | ||||
-rw-r--r-- | src/include/pg_config.h.in | 3 | ||||
-rw-r--r-- | src/tools/msvc/Solution.pm | 1 |
5 files changed, 10 insertions, 6 deletions
diff --git a/configure b/configure index 879f92202f3..0d52af55293 100755 --- a/configure +++ b/configure @@ -13596,7 +13596,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi -for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/uio.h sys/un.h termios.h ucred.h wctype.h +for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/signalfd.h sys/sockio.h sys/tas.h sys/uio.h sys/un.h termios.h ucred.h wctype.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.ac b/configure.ac index 95287705f6b..2afc822b128 100644 --- a/configure.ac +++ b/configure.ac @@ -1412,6 +1412,7 @@ AC_CHECK_HEADERS(m4_normalize([ sys/select.h sys/sem.h sys/shm.h + sys/signalfd.h sys/sockio.h sys/tas.h sys/uio.h diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c index 61c876beff0..5bb609b368d 100644 --- a/src/backend/storage/ipc/latch.c +++ b/src/backend/storage/ipc/latch.c @@ -43,6 +43,9 @@ #ifdef HAVE_SYS_EVENT_H #include <sys/event.h> #endif +#ifdef HAVE_SYS_SIGNALFD_H +#include <sys/signalfd.h> +#endif #ifdef HAVE_POLL_H #include <poll.h> #endif @@ -69,7 +72,7 @@ #if defined(WAIT_USE_EPOLL) || defined(WAIT_USE_POLL) || \ defined(WAIT_USE_KQUEUE) || defined(WAIT_USE_WIN32) /* don't overwrite manual choice */ -#elif defined(HAVE_SYS_EPOLL_H) +#elif defined(HAVE_SYS_EPOLL_H) && defined(HAVE_SYS_SIGNALFD_H) #define WAIT_USE_EPOLL #elif defined(HAVE_KQUEUE) #define WAIT_USE_KQUEUE @@ -81,10 +84,6 @@ #error "no wait set implementation available" #endif -#ifdef WAIT_USE_EPOLL -#include <sys/signalfd.h> -#endif - /* typedef in latch.h */ struct WaitEventSet { diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 912efdbbd12..28a1f0e9f0f 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -634,6 +634,9 @@ /* Define to 1 if you have the <sys/shm.h> header file. */ #undef HAVE_SYS_SHM_H +/* Define to 1 if you have the <sys/signalfd.h> header file. */ +#undef HAVE_SYS_SIGNALFD_H + /* Define to 1 if you have the <sys/sockio.h> header file. */ #undef HAVE_SYS_SOCKIO_H diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index ed1c53000ff..e6f20679dce 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -404,6 +404,7 @@ sub GenerateFiles HAVE_SYS_SELECT_H => undef, HAVE_SYS_SEM_H => undef, HAVE_SYS_SHM_H => undef, + HAVE_SYS_SIGNALFD_H => undef, HAVE_SYS_SOCKIO_H => undef, HAVE_SYS_STAT_H => 1, HAVE_SYS_TAS_H => undef, |