diff options
author | Daniel Lange <DLange@git.local> | 2021-03-21 17:48:41 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2021-03-21 17:48:41 +0100 |
commit | 6ea93fc6c0e4734ceb0cd85b77878a9033b1713c (patch) | |
tree | 9c118f9f1fbaf610eb8397ea2f348b8f1272e2fa /openbsd/Platform.c | |
parent | 63019065dce4bc14b1f8bf437d7314b30a1c5970 (diff) | |
parent | e4e3f6c390452b4996ece4c92284410e58634052 (diff) |
Merge branch 'openbsd' of cgzones/htop
Diffstat (limited to 'openbsd/Platform.c')
-rw-r--r-- | openbsd/Platform.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/openbsd/Platform.c b/openbsd/Platform.c index fee4b71b..eea21411 100644 --- a/openbsd/Platform.c +++ b/openbsd/Platform.c @@ -15,6 +15,8 @@ in the source distribution for its full text. #include <stdlib.h> #include <string.h> #include <time.h> +#include <sys/signal.h> // needs to be included before <sys/proc.h> for 'struct sigaltstack' +#include <sys/proc.h> #include <sys/resource.h> #include <sys/sensors.h> #include <sys/sysctl.h> @@ -162,8 +164,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { } int Platform_getMaxPid() { - // this is hard-coded in sys/proc.h - no sysctl exists - return 99999; + return 2 * THREAD_PID_OFFSET; } double Platform_setCPUValues(Meter* this, unsigned int cpu) { @@ -196,6 +197,8 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu) { v[CPU_METER_TEMPERATURE] = NAN; + v[CPU_METER_FREQUENCY] = (pl->cpuSpeed != -1) ? pl->cpuSpeed : NAN; + return totalPercent; } |