aboutsummaryrefslogtreecommitdiffstats
path: root/lib/os_mon/c_src/cpu_sup.c
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-09-06 15:28:10 +0200
committerFredrik Gustafsson <[email protected]>2013-09-06 15:28:10 +0200
commitdedc171a2504c97a1545aa53de53d0e3fddf63c7 (patch)
treeb941f00c6d696c95b3aa8b021eb450425e8cbcc2 /lib/os_mon/c_src/cpu_sup.c
parent68e94c10f2e06d44de0ffaa56513b34ef17cc697 (diff)
parent61f6e220b6399ae20f72e877628896872bc522ad (diff)
downloadotp-dedc171a2504c97a1545aa53de53d0e3fddf63c7.tar.gz
otp-dedc171a2504c97a1545aa53de53d0e3fddf63c7.tar.bz2
otp-dedc171a2504c97a1545aa53de53d0e3fddf63c7.zip
Merge branch 'maint'
Diffstat (limited to 'lib/os_mon/c_src/cpu_sup.c')
-rw-r--r--lib/os_mon/c_src/cpu_sup.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/os_mon/c_src/cpu_sup.c b/lib/os_mon/c_src/cpu_sup.c
index 7372d5b0e8..e9fd75a32c 100644
--- a/lib/os_mon/c_src/cpu_sup.c
+++ b/lib/os_mon/c_src/cpu_sup.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#if defined(__sun__)
#include <kstat.h>
@@ -120,7 +121,9 @@ typedef struct {
static void util_measure(unsigned int **result_vec, int *result_sz);
+#if defined(__sun__)
static unsigned int misc_measure(char* name);
+#endif
static void send(unsigned int data);
static void sendv(unsigned int data[], int ints);
static void error(char* err_msg);
@@ -140,7 +143,9 @@ int main(int argc, char** argv) {
int rc;
int sz;
unsigned int *rv;
+#if defined(__linux__)
unsigned int no_of_cpus = 0;
+#endif
#if defined(__sun__)
kstat_ctl = kstat_open();
@@ -288,10 +293,10 @@ static unsigned int misc_measure(char* name) {
if(!entry)
return -1;
- if(entry->data_type != KSTAT_DATA_ULONG)
+ if(entry->data_type != KSTAT_DATA_UINT32)
return -1;
- return entry->value.ul;
+ return entry->value.ui32;
}