diff options
author | Adam <Adam@anope.org> | 2016-11-21 20:56:39 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-11-22 08:49:43 -0500 |
commit | 7ddef68f44ecb01f891e55a680078f7857fb866f (patch) | |
tree | b4f772b14cefdfdcdacd27706a534f748d1f59d6 /src/socketengines | |
parent | 8647572f8f84c3c987e546ad40f876779f49424a (diff) |
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 { |