comparison src/getloadavg.c @ 3037:3c7a86dba45b

*** empty log message ***
author Roland McGrath <roland@gnu.org>
date Mon, 24 May 1993 21:41:18 +0000
parents a9e4ef13ce85
children 2b2b70186646
comparison
equal deleted inserted replaced
3036:98f500ca5593 3037:3c7a86dba45b
353 double loadavg[]; 353 double loadavg[];
354 int nelem; 354 int nelem;
355 { 355 {
356 int elem = 0; /* Return value. */ 356 int elem = 0; /* Return value. */
357 357
358 #ifdef NO_GET_LOAD_AVG
359 #define LDAV_DONE
360 /* Set errno to zero to indicate that there was no particular error;
361 this function just can't work at all on this system. */
362 errno = 0;
363 elem = -1;
364 #endif
365
358 #if !defined (LDAV_DONE) && defined (LINUX) 366 #if !defined (LDAV_DONE) && defined (LINUX)
359 #define LDAV_DONE 367 #define LDAV_DONE
360 #undef LOAD_AVE_TYPE 368 #undef LOAD_AVE_TYPE
361 369
362 #ifndef LINUX_LDAV_FILE 370 #ifndef LINUX_LDAV_FILE
538 loadavg[elem++] = load_ave[2] / 65536.0; 546 loadavg[elem++] = load_ave[2] / 65536.0;
539 #endif /* apollo */ 547 #endif /* apollo */
540 548
541 #if !defined (LDAV_DONE) && defined (OSF_MIPS) 549 #if !defined (LDAV_DONE) && defined (OSF_MIPS)
542 #define LDAV_DONE 550 #define LDAV_DONE
543 #define LDAV_PRIVILEGED
544 551
545 struct tbl_loadavg load_ave; 552 struct tbl_loadavg load_ave;
546 table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave)); 553 table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave));
547 loadavg[elem++] = (load_ave.tl_lscale == 0 554 loadavg[elem++]
548 ? load_ave.tl_avenrun.d[0] 555 = (load_ave.tl_lscale == 0
549 : (load_ave.tl_avenrun.l[0] / load_ave.tl_lscale)); 556 ? load_ave.tl_avenrun.d[0]
557 : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
550 #endif /* OSF_MIPS */ 558 #endif /* OSF_MIPS */
551 559
552 #if !defined (LDAV_DONE) && defined (VMS) 560 #if !defined (LDAV_DONE) && defined (VMS)
553 /* VMS specific code -- read from the Load Ave driver. */ 561 /* VMS specific code -- read from the Load Ave driver. */
554 562