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

Commit53b1578

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 parent28afff3 commit53b1578

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
@@ -574,9 +574,18 @@ CreateWaitEventSet(MemoryContext context, int nevents)
574574
set->nevents_space=nevents;
575575

576576
#if defined(WAIT_USE_EPOLL)
577+
#ifdefEPOLL_CLOEXEC
577578
set->epoll_fd=epoll_create1(EPOLL_CLOEXEC);
578579
if (set->epoll_fd<0)
579580
elog(ERROR,"epoll_create1 failed: %m");
581+
#else
582+
/* cope with ancient glibc lacking epoll_create1 (e.g., RHEL5) */
583+
set->epoll_fd=epoll_create(nevents);
584+
if (set->epoll_fd<0)
585+
elog(ERROR,"epoll_create failed: %m");
586+
if (fcntl(set->epoll_fd,F_SETFD,FD_CLOEXEC)==-1)
587+
elog(ERROR,"fcntl(F_SETFD) failed on epoll descriptor: %m");
588+
#endif/* EPOLL_CLOEXEC */
580589
#elif defined(WAIT_USE_WIN32)
581590

582591
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp