From 618d13196dafd670a6c136a05ab27c007744494a Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 20 Dec 2012 00:07:32 +0000 Subject: OpenBSD does not have KERN_MAXFILESPERPROC. --- src/socketengines/socketengine_kqueue.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/socketengines') 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 -/** 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) -- cgit v1.2.3