diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-11-22 14:50:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-22 14:50:32 +0100 |
commit | 491340999d4e8eefa99f15259fadc2af914dd733 (patch) | |
tree | b4f772b14cefdfdcdacd27706a534f748d1f59d6 /src/socketengines | |
parent | 8647572f8f84c3c987e546ad40f876779f49424a (diff) | |
parent | 7ddef68f44ecb01f891e55a680078f7857fb866f (diff) |
Merge pull request #1257 from Adam-/insp20+musl
socketengine_epoll: use getrlimit not ulimit
Diffstat (limited to 'src/socketengines')
-rw-r--r-- | src/socketengines/socketengine_epoll.cpp | 9 |
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 { |