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

Commitd1b9099

Browse files
committed
Remove latch.c workaround for Linux < 2.6.27.
Commit82ebbeb added a workaround for systems with no epoll_create1()and EPOLL_CLOEXEC. Linux < 2.6.27 and glibc < 2.9 are long gone. Nowseems like a good time to drop the extra code, because otherwise we'dhave to add similar already-dead workaround code to new patches usingXXX_CLOEXEC flags that arrived in the same kernel release.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CA%2BhUKGKL_%3DaO%3Dr30N%3Ds9VoDgTqHpRSzePRbA9dkYO7snc7HsxA%40mail.gmail.com
1 parent943eb47 commitd1b9099

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

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

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -666,31 +666,12 @@ CreateWaitEventSet(MemoryContext context, int nevents)
666666
/* treat this as though epoll_create1 itself returned EMFILE */
667667
elog(ERROR,"epoll_create1 failed: %m");
668668
}
669-
#ifdefEPOLL_CLOEXEC
670669
set->epoll_fd=epoll_create1(EPOLL_CLOEXEC);
671670
if (set->epoll_fd<0)
672671
{
673672
ReleaseExternalFD();
674673
elog(ERROR,"epoll_create1 failed: %m");
675674
}
676-
#else
677-
/* cope with ancient glibc lacking epoll_create1 (e.g., RHEL5) */
678-
set->epoll_fd=epoll_create(nevents);
679-
if (set->epoll_fd<0)
680-
{
681-
ReleaseExternalFD();
682-
elog(ERROR,"epoll_create failed: %m");
683-
}
684-
if (fcntl(set->epoll_fd,F_SETFD,FD_CLOEXEC)==-1)
685-
{
686-
intsave_errno=errno;
687-
688-
close(set->epoll_fd);
689-
ReleaseExternalFD();
690-
errno=save_errno;
691-
elog(ERROR,"fcntl(F_SETFD) failed on epoll descriptor: %m");
692-
}
693-
#endif/* EPOLL_CLOEXEC */
694675
#elif defined(WAIT_USE_KQUEUE)
695676
if (!AcquireExternalFD())
696677
{
@@ -736,7 +717,7 @@ CreateWaitEventSet(MemoryContext context, int nevents)
736717
*
737718
* Note: preferably, this shouldn't have to free any resources that could be
738719
* inherited across an exec(). If it did, we'd likely leak those resources in
739-
* many scenarios. For the epoll case, we ensure that by settingFD_CLOEXEC
720+
* many scenarios. For the epoll case, we ensure that by settingEPOLL_CLOEXEC
740721
* when the FD is created. For the Windows case, we assume that the handles
741722
* involved are non-inheritable.
742723
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp