Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c5f5b4d

Browse files
committed
Test honestly for <sys/signalfd.h>.
Commit 6a2a70a 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
1 parent f48385c commit c5f5b4d

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13596,7 +13596,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
1359613596
fi
1359713597

1359813598

13599-
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
13599+
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
1360013600
do :
1360113601
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1360213602
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ AC_CHECK_HEADERS(m4_normalize([
14121412
sys/select.h
14131413
sys/sem.h
14141414
sys/shm.h
1415+
sys/signalfd.h
14151416
sys/sockio.h
14161417
sys/tas.h
14171418
sys/uio.h

src/backend/storage/ipc/latch.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
#ifdef HAVE_SYS_EVENT_H
4444
#include <sys/event.h>
4545
#endif
46+
#ifdef HAVE_SYS_SIGNALFD_H
47+
#include <sys/signalfd.h>
48+
#endif
4649
#ifdef HAVE_POLL_H
4750
#include <poll.h>
4851
#endif
@@ -69,7 +72,7 @@
6972
#if defined(WAIT_USE_EPOLL) || defined(WAIT_USE_POLL) || \
7073
defined(WAIT_USE_KQUEUE) || defined(WAIT_USE_WIN32)
7174
/* don't overwrite manual choice */
72-
#elif defined(HAVE_SYS_EPOLL_H)
75+
#elif defined(HAVE_SYS_EPOLL_H) && defined(HAVE_SYS_SIGNALFD_H)
7376
#define WAIT_USE_EPOLL
7477
#elif defined(HAVE_KQUEUE)
7578
#define WAIT_USE_KQUEUE
@@ -81,10 +84,6 @@
8184
#error "no wait set implementation available"
8285
#endif
8386

84-
#ifdef WAIT_USE_EPOLL
85-
#include <sys/signalfd.h>
86-
#endif
87-
8887
/* typedef in latch.h */
8988
struct WaitEventSet
9089
{

src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,9 @@
634634
/* Define to 1 if you have the <sys/shm.h> header file. */
635635
#undef HAVE_SYS_SHM_H
636636

637+
/* Define to 1 if you have the <sys/signalfd.h> header file. */
638+
#undef HAVE_SYS_SIGNALFD_H
639+
637640
/* Define to 1 if you have the <sys/sockio.h> header file. */
638641
#undef HAVE_SYS_SOCKIO_H
639642

src/tools/msvc/Solution.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ sub GenerateFiles
404404
HAVE_SYS_SELECT_H => undef,
405405
HAVE_SYS_SEM_H => undef,
406406
HAVE_SYS_SHM_H => undef,
407+
HAVE_SYS_SIGNALFD_H => undef,
407408
HAVE_SYS_SOCKIO_H => undef,
408409
HAVE_SYS_STAT_H => 1,
409410
HAVE_SYS_TAS_H => undef,

0 commit comments

Comments
 (0)