summaryrefslogtreecommitdiff
path: root/src/socketengines/socketengine_epoll.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-11-22 14:50:32 +0100
committerGitHub <noreply@github.com>2016-11-22 14:50:32 +0100
commit491340999d4e8eefa99f15259fadc2af914dd733 (patch)
treeb4f772b14cefdfdcdacd27706a534f748d1f59d6 /src/socketengines/socketengine_epoll.cpp
parent8647572f8f84c3c987e546ad40f876779f49424a (diff)
parent7ddef68f44ecb01f891e55a680078f7857fb866f (diff)
Merge pull request #1257 from Adam-/insp20+musl
socketengine_epoll: use getrlimit not ulimit
Diffstat (limited to 'src/socketengines/socketengine_epoll.cpp')
-rw-r--r--src/socketengines/socketengine_epoll.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp
index f2837777a..d5f017347 100644
--- a/src/socketengines/socketengine_epoll.cpp
+++ b/src/socketengines/socketengine_epoll.cpp
@@ -25,7 +25,7 @@
#include "exitcodes.h"
#include "socketengine.h"
#include <sys/epoll.h>
-#include <ulimit.h>
+#include <sys/resource.h>
#include <iostream>
#define EP_DELAY 5
@@ -55,10 +55,11 @@ public:
EPollEngine::EPollEngine()
{
CurrentSetSize = 0;
- int max = ulimit(4, 0);
- if (max > 0)
+
+ struct rlimit limit;
+ if (!getrlimit(RLIMIT_NOFILE, &limit))
{
- MAX_DESCRIPTORS = max;
+ MAX_DESCRIPTORS = limit.rlim_cur;
}
else
{