summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1991-07-24 23:47:06 +0000
committerJim Blandy <jimb@redhat.com>1991-07-24 23:47:06 +0000
commit9b7828a5ad16b476e9359bfbe020e0bbc6cf3831 (patch)
treedbee7356669b9f9dc41b8bd06ecaf40d51c768ca /src/fns.c
parentb10a43799500bb04ab70cca9e780262fda5812fe (diff)
downloademacs-9b7828a5ad16b476e9359bfbe020e0bbc6cf3831.tar.gz
emacs-9b7828a5ad16b476e9359bfbe020e0bbc6cf3831.tar.bz2
emacs-9b7828a5ad16b476e9359bfbe020e0bbc6cf3831.zip
*** empty log message ***
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fns.c b/src/fns.c
index 649bddd7142..3be50027b1c 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -51,6 +51,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif /* not VMS */
#endif /* LOAD_AVE_TYPE */
+#ifdef DGUX
+#include <sys/dg_sys_info.h> /* for load average info - DJB */
+#endif
+
/* Note on some machines this defines `vector' as a typedef,
so make sure we don't use that name in this file. */
#undef vector
@@ -1181,6 +1185,11 @@ and can rub it out if not confirmed.")
}
/* Avoid static vars inside a function since in HPUX they dump as pure. */
+#ifdef DGUX
+static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
+
+#else /* Not DGUX */
+
static int ldav_initialized;
static int ldav_channel;
#ifdef LOAD_AVE_TYPE
@@ -1192,6 +1201,7 @@ static struct nlist ldav_nl[2];
#define channel ldav_channel
#define initialized ldav_initialized
#define nl ldav_nl
+#endif /* Not DGUX */
DEFUN ("load-average", Fload_average, Sload_average, 0, 0, 0,
"Return list of 1 minute, 5 minute and 15 minute load averages.\n\
@@ -1199,6 +1209,19 @@ Each of the three load averages is multiplied by 100,\n\
then converted to integer.")
()
{
+#ifdef DGUX
+ /* perhaps there should be a "sys_load_avg" call in sysdep.c?! - DJB */
+ load_info.one_minute = 0.0; /* just in case there is an error */
+ load_info.five_minute = 0.0;
+ load_info.fifteen_minute = 0.0;
+ dg_sys_info (&load_info, DG_SYS_INFO_LOAD_INFO_TYPE,
+ DG_SYS_INFO_LOAD_VERSION_0);
+
+ return Fcons (make_number ((int)(load_info.one_minute * 100.0)),
+ Fcons (make_number ((int)(load_info.five_minute * 100.0)),
+ Fcons (make_number ((int)(load_info.fifteen_minute * 100.0)),
+ Qnil)));
+#else /* not DGUX */
#ifndef LOAD_AVE_TYPE
error ("load-average not implemented for this operating system");
@@ -1320,6 +1343,7 @@ then converted to integer.")
Fcons (make_number (LOAD_AVE_CVT (load_ave[2])),
Qnil)));
#endif /* LOAD_AVE_TYPE */
+#endif /* not DGUX */
}
#undef channel