From 76f1ba946972dbff089b27d64748afc1c0d95c6a Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 7 Jun 2014 13:33:50 +0200 Subject: socketengine_epoll Pass a dummy value to epoll_create() that does not depend on GetMaxFds() From man epoll: Since Linux 2.6.8, the size argument is unused, but must be greater than zero. (The kernel dynamically sizes the required data structures without needing this initial hint.) --- src/socketengines/socketengine_epoll.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/socketengines') diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index a54907fca..1c4d8963d 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -54,8 +54,9 @@ void SocketEngine::Init() ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } - // This is not a maximum, just a hint at the eventual number of sockets that may be polled. - EngineHandle = epoll_create(GetMaxFds() / 4); + // 128 is not a maximum, just a hint at the eventual number of sockets that may be polled, + // and it is completely ignored by 2.6.8 and later kernels, except it must be larger than zero. + EngineHandle = epoll_create(128); if (EngineHandle == -1) { -- cgit v1.2.3