diff options
author | Peter Powell <petpow@saberuk.com> | 2012-12-20 00:07:32 +0000 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-12-25 18:39:03 +0100 |
commit | 618d13196dafd670a6c136a05ab27c007744494a (patch) | |
tree | 78d6d6cc84f8784ebe25615557fc3b753177dbb8 /src/socketengines | |
parent | 5a378e1b08ec69cb57f2e52899a5aa7b7424cc75 (diff) |
OpenBSD does not have KERN_MAXFILESPERPROC.
Diffstat (limited to 'src/socketengines')
-rw-r--r-- | src/socketengines/socketengine_kqueue.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index 5dd653363..e24146943 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -27,7 +27,7 @@ #include "socketengine.h" #include <iostream> -/** A specialisation of the SocketEngine class, designed to use FreeBSD kqueue(). +/** A specialisation of the SocketEngine class, designed to use BSD kqueue(). */ class KQueueEngine : public SocketEngine { @@ -63,7 +63,11 @@ KQueueEngine::KQueueEngine() size_t len; mib[0] = CTL_KERN; +#ifdef KERN_MAXFILESPERPROC mib[1] = KERN_MAXFILESPERPROC; +#else + mib[1] = KERN_MAXFILES; +#endif len = sizeof(MAX_DESCRIPTORS); sysctl(mib, 2, &MAX_DESCRIPTORS, &len, NULL, 0); if (MAX_DESCRIPTORS <= 0) |