diff --git a/ChangeLog b/ChangeLog index ba0f860b..532dbb72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-29 Doug MacEachern + + * Fix cpu ticks to msec on linux/ia64 + Submitted by: Jan Kneschke + 2007-03-24 Doug MacEachern * Implement proc_state_t.threads on OS X diff --git a/include/sigar_private.h b/include/sigar_private.h index 97994b78..36756502 100644 --- a/include/sigar_private.h +++ b/include/sigar_private.h @@ -118,8 +118,11 @@ ((sigar_uint64_t)(s) * (sigar_uint64_t)SIGAR_NSEC) /* cpu ticks to milliseconds */ -#define SIGAR_TICK2MSEC(s) ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_MSEC / sigar->ticks)) -#define SIGAR_TICK2NSEC(s) ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_NSEC / sigar->ticks)) +#define SIGAR_TICK2MSEC(s) \ + ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_MSEC / (double)sigar->ticks)) + +#define SIGAR_TICK2NSEC(s) \ + ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_NSEC / (double)sigar->ticks)) #define IFTYPE_LO 2 #define IFTYPE_ETH 3