From 96b619cc129afed52411b9fad3407037a1cb7207 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 02:47:26 +0200 Subject: Adding upstream version 4.92. Signed-off-by: Daniel Baumann --- OS/unsupported/os.c-HI-OSF | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 OS/unsupported/os.c-HI-OSF (limited to 'OS/unsupported/os.c-HI-OSF') diff --git a/OS/unsupported/os.c-HI-OSF b/OS/unsupported/os.c-HI-OSF new file mode 100644 index 0000000..5e3d336 --- /dev/null +++ b/OS/unsupported/os.c-HI-OSF @@ -0,0 +1,35 @@ +/************************************************* +* 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 + +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 */ -- cgit v1.2.3