Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit82ebbeb

Browse files
committed
Cope with glibc too old to have epoll_create1().
Commitfa31b6f supposed that we didn't have to worry about thatanymore, but it seems that RHEL5 is like that, and that's stilla supported platform. Put back the prior coding under an #ifdef,adding an explicit fcntl() to retain the desired CLOEXEC property.Discussion:https://postgr.es/m/12307.1493325329@sss.pgh.pa.us
1 parent2bef06d commit82ebbeb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/backend/storage/ipc/latch.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,18 @@ CreateWaitEventSet(MemoryContext context, int nevents)
565565
set->nevents_space=nevents;
566566

567567
#if defined(WAIT_USE_EPOLL)
568+
#ifdefEPOLL_CLOEXEC
568569
set->epoll_fd=epoll_create1(EPOLL_CLOEXEC);
569570
if (set->epoll_fd<0)
570571
elog(ERROR,"epoll_create1 failed: %m");
572+
#else
573+
/* cope with ancient glibc lacking epoll_create1 (e.g., RHEL5) */
574+
set->epoll_fd=epoll_create(nevents);
575+
if (set->epoll_fd<0)
576+
elog(ERROR,"epoll_create failed: %m");
577+
if (fcntl(set->epoll_fd,F_SETFD,FD_CLOEXEC)==-1)
578+
elog(ERROR,"fcntl(F_SETFD) failed on epoll descriptor: %m");
579+
#endif/* EPOLL_CLOEXEC */
571580
#elif defined(WAIT_USE_WIN32)
572581

573582
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp