1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 2001 */
6 /* See the file NOTICE for conditions of use and distribution. */
8 /* HI-OSF-specific code. This is concatenated onto the generic
9 src/os.c file. OSF has an apparently unique way of getting the
10 load average, so we provide a unique function here, and define
11 OS_LOAD_AVERAGE to stop src/os.c trying to provide the function. */
13 #ifndef OS_LOAD_AVERAGE
14 #define OS_LOAD_AVERAGE
16 #include <sys/table.h>
22 struct tbl_loadavg load_avg;
24 table (TBL_LOADAVG, 0, &load_avg, 1, sizeof (load_avg));
26 avg = (load_avg.tl_lscale == 0)?
27 load_avg.tl_avenrun.d[0] :
28 (load_avg.tl_avenrun.l[0] / (double)load_avg.tl_lscale);
30 return (int)(avg * 1000.0);
33 #endif /* OS_LOAD_AVERAGE */
35 /* End of os.c-HI-OSF */