1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 2001 */
6 /* SPDX-License-Identifier: GPL-2.0-or-later */
7 /* See the file NOTICE for conditions of use and distribution. */
9 /* HI-OSF-specific code. This is concatenated onto the generic
10 src/os.c file. OSF has an apparently unique way of getting the
11 load average, so we provide a unique function here, and define
12 OS_LOAD_AVERAGE to stop src/os.c trying to provide the function. */
14 #ifndef OS_LOAD_AVERAGE
15 #define OS_LOAD_AVERAGE
17 #include <sys/table.h>
23 struct tbl_loadavg load_avg;
25 table (TBL_LOADAVG, 0, &load_avg, 1, sizeof (load_avg));
27 avg = (load_avg.tl_lscale == 0)?
28 load_avg.tl_avenrun.d[0] :
29 (load_avg.tl_avenrun.l[0] / (double)load_avg.tl_lscale);
31 return (int)(avg * 1000.0);
34 #endif /* OS_LOAD_AVERAGE */
36 /* End of os.c-HI-OSF */