summaryrefslogtreecommitdiff
path: root/src/socketengines
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengines')
-rw-r--r--src/socketengines/socketengine_kqueue.cpp6
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)