Mercurial > hg > xemacs-beta
diff src/getloadavg.c @ 185:3d6bfa290dbd r20-3b19
Import from CVS: tag r20-3b19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:55:28 +0200 |
parents | 59463afc5666 |
children | 850242ba4a81 |
line wrap: on
line diff
--- a/src/getloadavg.c Mon Aug 13 09:54:24 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 09:55:28 2007 +0200 @@ -537,7 +537,7 @@ #ifdef XEMACS #if ! defined (LDAV_DONE) && defined (HAVE_KSTAT_H) && defined (HAVE_LIBKSTAT) #define LDAV_DONE - + /* getloadavg is best implemented using kstat (kernel stats), on systems (like SunOS5) that support it, since you don't have to be superusers to use it. @@ -559,7 +559,7 @@ return -1; if (kstat_read(kc, ksp, ksp->ks_data) < 0) return -1; - buf = malloc(ksp->ks_data_size); + buf = (kstat_named_t *) malloc (ksp->ks_data_size); if (!buf) return -1; memcpy(buf, ksp->ks_data, ksp->ks_data_size); @@ -568,7 +568,7 @@ for (elem = 0; elem < nelem; elem++) loadavg[elem] = (buf + 6 + elem)->value.ul / 256.0; free(buf); - + #endif /* HAVE_KSTAT_H && HAVE_LIBKSTAT */ #if !defined (LDAV_DONE) && defined (HAVE_SYS_PSTAT_H)