blob: a21765022c6948611930d41cf49608ec33cb6e9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* $Cambridge: exim/src/OS/os.c-HI-OSF,v 1.1 2004/10/06 15:07:39 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
/* Copyright (c) University of Cambridge 2001 */
/* See the file NOTICE for conditions of use and distribution. */
/* HI-OSF-specific code. This is concatenated onto the generic
src/os.c file. OSF has an apparently unique way of getting the
load average, so we provide a unique function here, and define
OS_LOAD_AVERAGE to stop src/os.c trying to provide the function. */
#ifndef OS_LOAD_AVERAGE
#define OS_LOAD_AVERAGE
#include <sys/table.h>
int
os_getloadavg(void)
{
double avg;
struct tbl_loadavg load_avg;
table (TBL_LOADAVG, 0, &load_avg, 1, sizeof (load_avg));
avg = (load_avg.tl_lscale == 0)?
load_avg.tl_avenrun.d[0] :
(load_avg.tl_avenrun.l[0] / (double)load_avg.tl_lscale);
return (int)(avg * 1000.0);
}
#endif /* OS_LOAD_AVERAGE */
/* End of os.c-HI-OSF */
|