netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=0204b2d2bcd33e2e11ef723fe351af9802d48bfb

commit 0204b2d2bcd33e2e11ef723fe351af9802d48bfb
Author: Alastair Poole <nets...@gmail.com>
Date:   Sun Mar 14 10:41:16 2021 +0000

    cpu: openbsd. report cpufreq.
    
    0-100% is portable but really useless for userspace thingies like
    this.
---
 src/bin/system/machine/cpu.bogox | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/bin/system/machine/cpu.bogox b/src/bin/system/machine/cpu.bogox
index e42fd5a..eff7440 100644
--- a/src/bin/system/machine/cpu.bogox
+++ b/src/bin/system/machine/cpu.bogox
@@ -564,7 +564,10 @@ system_cpu_frequency_min_max_get(int *min, int *max)
      }
 
 #elif defined(__OpenBSD__)
+   *min = 0;
+   *max = 100;
 
+   return 0;
 #endif
    (void) freq_min; (void) freq_max;
    return -1;
@@ -582,7 +585,7 @@ system_cpu_frequency_get(void)
 #elif defined(__OpenBSD__)
    int mib[2] = { CTL_HW, HW_CPUSPEED };
    size_t len = sizeof(freq);
-   if (sysctl(mib, sizeof(mib), &freq, &len, NULL, 0) != -1)
+   if (sysctl(mib, 2, &freq, &len, NULL, 0) != -1)
      freq *= 1000;
 #elif defined(__linux__)
    FILE *f;

-- 


Reply via email to