From c23461a22a1ead0a34dc209c2918ec4ccaf61475 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 9 Feb 2022 14:24:55 -0500 Subject: Test honestly for . Commit 6a2a70a02 supposed that any platform having would also have . 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 --- src/backend/storage/ipc/latch.c | 9 ++++----- src/include/pg_config.h.in | 3 +++ src/tools/msvc/Solution.pm | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c index 1d893cf863d..6ff1ecbe098 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 #endif +#ifdef HAVE_SYS_SIGNALFD_H +#include +#endif #ifdef HAVE_POLL_H #include #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 -#endif - /* typedef in latch.h */ struct WaitEventSet { diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index d69d461ff2c..6c7eea17d45 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -640,6 +640,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNALFD_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 138b630b999..c983f506f97 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -406,6 +406,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, -- cgit v1.2.3