summaryrefslogtreecommitdiff
path: root/src/getloadavg.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1993-05-24 21:41:18 +0000
committerRoland McGrath <roland@gnu.org>1993-05-24 21:41:18 +0000
commit0631d5d32af66ae34a5ea48dd8de88c7716eedec (patch)
treeff5ac4efb85e84e56c8bc06da621c2705826e6cd /src/getloadavg.c
parent811b7dd37a6460254b5a346a33761e58d2108c3a (diff)
downloademacs-0631d5d32af66ae34a5ea48dd8de88c7716eedec.tar.gz
*** empty log message ***
Diffstat (limited to 'src/getloadavg.c')
-rw-r--r--src/getloadavg.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/getloadavg.c b/src/getloadavg.c
index 7c1c31705d8..70035395787 100644
--- a/src/getloadavg.c
+++ b/src/getloadavg.c
@@ -355,6 +355,14 @@ getloadavg (loadavg, nelem)
{
int elem = 0; /* Return value. */
+#ifdef NO_GET_LOAD_AVG
+#define LDAV_DONE
+ /* Set errno to zero to indicate that there was no particular error;
+ this function just can't work at all on this system. */
+ errno = 0;
+ elem = -1;
+#endif
+
#if !defined (LDAV_DONE) && defined (LINUX)
#define LDAV_DONE
#undef LOAD_AVE_TYPE
@@ -540,13 +548,13 @@ getloadavg (loadavg, nelem)
#if !defined (LDAV_DONE) && defined (OSF_MIPS)
#define LDAV_DONE
-#define LDAV_PRIVILEGED
struct tbl_loadavg load_ave;
table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave));
- loadavg[elem++] = (load_ave.tl_lscale == 0
- ? load_ave.tl_avenrun.d[0]
- : (load_ave.tl_avenrun.l[0] / load_ave.tl_lscale));
+ loadavg[elem++]
+ = (load_ave.tl_lscale == 0
+ ? load_ave.tl_avenrun.d[0]
+ : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
#endif /* OSF_MIPS */
#if !defined (LDAV_DONE) && defined (VMS)