diff options
author | Slávek Banko <[email protected]> | 2019-02-19 16:55:03 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-02-19 16:55:17 +0100 |
commit | 36dada973a7f4413c9a121be92abdade8b26b712 (patch) | |
tree | eca2cd99173e6c1da847f9bdb2723053faba8912 /src | |
parent | 8a9ec5847da34390d9f9e19f7bf7e9621c5114eb (diff) | |
download | kcpuload-36dada973a7f4413c9a121be92abdade8b26b712.tar.gz kcpuload-36dada973a7f4413c9a121be92abdade8b26b712.zip |
Fix FTBFS on FreeBSD
Taken from FreeBSD patches.
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 952f7c921e570e1e2d90cabfd232f6a76ce9f630)
Diffstat (limited to 'src')
-rw-r--r-- | src/kcpuproc.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kcpuproc.cpp b/src/kcpuproc.cpp index f7fbe4f..bbc21ce 100644 --- a/src/kcpuproc.cpp +++ b/src/kcpuproc.cpp @@ -18,8 +18,12 @@ // BSD-specific includes. #ifdef Q_OS_BSD4 -#include <sys/dkstat.h> #include <sys/param.h> +#if defined(__FreeBSD__) && __FreeBSD_version >= 500101 +#include <sys/resource.h> +#else +#include <sys/dkstat.h> +#endif #include <sys/sysctl.h> #include <string.h> #include <kvm.h> @@ -134,7 +138,7 @@ void KCPUProc::readLoad() { static int oidCpuTime[CTL_MAXNAME + 2]; static size_t oidCpuTimeLen = sizeof(oidCpuTime); long cpuTime[CPUSTATES]; - unsigned int cpuTimeLen = sizeof(cpuTime); + size_t cpuTimeLen = sizeof(cpuTime); static char *name = "kern.cp_time"; static int initialized = 0; |