From ee70e395742695c3879b1cf5024b8086ec5c5441 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 17 Jan 2007 17:19:06 +0000 Subject: [PATCH] use kstat_named_t.value.ui64 when built for sparc64 --- src/os/solaris/sigar_os.h | 8 +++++++- src/os/solaris/solaris_sigar.c | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/os/solaris/sigar_os.h b/src/os/solaris/sigar_os.h index 4977176d..e54c8ac1 100644 --- a/src/os/solaris/sigar_os.h +++ b/src/os/solaris/sigar_os.h @@ -253,9 +253,15 @@ struct sigar_t { solaris_mib2_t mib2; }; +#ifdef SIGAR_64BIT +#define KSTAT_UINT ui64 +#else +#define KSTAT_UINT ui32 +#endif + #define kSTAT_uint(v, type) \ ((sigar->koffsets.type[v] == -2) ? 0 : \ - ((kstat_named_t *)ksp->ks_data + sigar->koffsets.type[v])->value.ui32) + ((kstat_named_t *)ksp->ks_data + sigar->koffsets.type[v])->value.KSTAT_UINT) #define kSYSTEM(v) kSTAT_uint(v, system) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index af8c35f8..3e9761df 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -824,7 +824,7 @@ static int ucb_ps_args_get(sigar_t *sigar, sigar_pid_t pid, } else { snprintf(buffer, sizeof(buffer), - "/usr/ucb/ps -ww %ld", pid); + "/usr/ucb/ps -ww %ld", (long)pid); if (!(fp = popen(buffer, "r"))) { return errno; @@ -1991,7 +1991,7 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat, int i; for (i=0; i