summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiclas Rosenvik <youremailsarecrap@gmail.com>2019-11-13 20:20:10 +0000
committerGlenn Strauss <gstrauss@gluelogic.com>2020-01-30 21:47:59 -0500
commit8c9b5480f33e24c42c52df54629f58d1de58cd4f (patch)
treec8f97aa71b258ae9dd78f5e40b36e03829ec48f9
parent15cdc313b500e2473de7bafdcf1c703dbfd11e56 (diff)
downloadlighttpd-1.x-8c9b5480f33e24c42c52df54629f58d1de58cd4f.tar.gz
lighttpd-1.x-8c9b5480f33e24c42c52df54629f58d1de58cd4f.zip
[core] Solaris has getloadavg in sys/loadavg.h
SunOS/Solaris/Illumos has getloadavg declared in sys/loadavg.h . github: closes #101
-rw-r--r--SConstruct1
-rw-r--r--configure.ac1
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/config.h.cmake1
-rw-r--r--src/meson.build1
-rw-r--r--src/server.c4
6 files changed, 9 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index ea845152..40f7d82b 100644
--- a/SConstruct
+++ b/SConstruct
@@ -360,6 +360,7 @@ if 1:
'sys/devpoll.h',
'sys/epoll.h',
'sys/filio.h',
+ 'sys/loadavg.h',
'sys/poll.h',
'sys/port.h',
'sys/prctl.h',
diff --git a/configure.ac b/configure.ac
index 6afa419f..dbddfb93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,6 +112,7 @@ AC_CHECK_HEADERS([\
sys/epoll.h \
sys/event.h \
sys/filio.h \
+ sys/loadavg.h \
sys/mman.h \
sys/poll.h \
sys/prctl.h \
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7d17b05a..1bdef070 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -86,6 +86,7 @@ set(CMAKE_REQUIRED_FLAGS "-include sys/types.h")
check_include_files(sys/event.h HAVE_SYS_EVENT_H)
set(CMAKE_REQUIRED_FLAGS)
check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
+check_include_files(sys/loadavg.h HAVE_SYS_LOADAVG_H)
check_include_files(sys/poll.h HAVE_SYS_POLL_H)
check_include_files(sys/port.h HAVE_SYS_PORT_H)
check_include_files(sys/prctl.h HAVE_SYS_PRCTL_H)
diff --git a/src/config.h.cmake b/src/config.h.cmake
index 4afc0103..d6936313 100644
--- a/src/config.h.cmake
+++ b/src/config.h.cmake
@@ -16,6 +16,7 @@
#cmakedefine HAVE_SYS_DEVPOLL_H
#cmakedefine HAVE_SYS_EPOLL_H
#cmakedefine HAVE_SYS_EVENT_H
+#cmakedefine HAVE_SYS_LOADAVG_H
#cmakedefine HAVE_SYS_MMAN_H
#cmakedefine HAVE_SYS_POLL_H
#cmakedefine HAVE_SYS_PORT_H
diff --git a/src/meson.build b/src/meson.build
index 4bc92ad5..b6432712 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -29,6 +29,7 @@ conf_data = configuration_data()
conf_data.set('HAVE_SYS_DEVPOLL_H', compiler.has_header('sys/devpoll.h'))
conf_data.set('HAVE_SYS_EPOLL_H', compiler.has_header('sys/epoll.h'))
conf_data.set('HAVE_SYS_EVENT_H', compiler.has_header('sys/event.h'))
+conf_data.set('HAVE_SYS_LOADAVG_H', compiler.has_header('sys/loadavg.h'))
conf_data.set('HAVE_SYS_MMAN_H', compiler.has_header('sys/mman.h'))
conf_data.set('HAVE_SYS_POLL_H', compiler.has_header('sys/poll.h'))
conf_data.set('HAVE_SYS_PORT_H', compiler.has_header('sys/port.h'))
diff --git a/src/server.c b/src/server.c
index 25175056..0862585f 100644
--- a/src/server.c
+++ b/src/server.c
@@ -63,6 +63,10 @@
# include <syslog.h>
#endif
+#ifdef HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif