--- a/src/main/httpserver.cpp
+++ b/src/main/httpserver.cpp
@@ -127,7 +127,7 @@
 
 #if defined(__FreeBSD__ ) || defined(__NetBSD__) || defined(__OpenBSD__) \
     || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
-#include <sys/sysctl.h>
+#include <linux/sysctl.h>
 #endif
 
 #define FILEMODE            0644
--- a/src/main/lshttpdmain.cpp
+++ b/src/main/lshttpdmain.cpp
@@ -46,7 +46,7 @@
 #include <util/stringlist.h>
 #include <util/signalutil.h>
 #include <util/vmembuf.h>
-#include <sys/sysctl.h>
+#include <linux/sysctl.h>
 
 #include <extensions/cgi/cgidworker.h>
 #include <extensions/registry/extappregistry.h>
