summaryrefslogtreecommitdiff
path: root/getloadavg.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1998-07-30 20:54:47 +0000
committerPaul Smith <psmith@gnu.org>1998-07-30 20:54:47 +0000
commite2403327e9913bbcbd515f9c38b8f4e26fb9b0d9 (patch)
tree8ac64ff471e0a976daf75ef913c084adba4972fc /getloadavg.c
parent65a7296e2c81b04761b3f024572310a02c9de691 (diff)
downloadgunmake-e2403327e9913bbcbd515f9c38b8f4e26fb9b0d9.tar.gz
GNU make release 3.77.
Diffstat (limited to 'getloadavg.c')
-rw-r--r--getloadavg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/getloadavg.c b/getloadavg.c
index adc4bef..154f18d 100644
--- a/getloadavg.c
+++ b/getloadavg.c
@@ -35,6 +35,7 @@
LOAD_AVE_TYPE Type of the load average array in the kernel.
Must be defined unless one of
apollo, DGUX, NeXT, or UMAX is defined;
+ or we have libkstat;
otherwise, no load average is available.
NLIST_STRUCT Include nlist.h, not a.out.h, and
the nlist n_name element is a pointer,
@@ -500,6 +501,7 @@ extern int errno;
# include <sys/file.h>
# endif
+
/* Avoid static vars inside a function since in HPUX they dump as pure. */
# ifdef NeXT
@@ -516,7 +518,7 @@ static unsigned int samples;
static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
# endif /* DGUX */
-# ifdef LOAD_AVE_TYPE
+#if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE)
/* File descriptor open to /dev/kmem or VMS load ave driver. */
static int channel;
/* Nonzero iff channel is valid. */
@@ -524,15 +526,15 @@ static int getloadavg_initialized;
/* Offset in kmem to seek to read load average, or 0 means invalid. */
static long offset;
-# if !defined(VMS) && !defined(sgi) && !defined(__linux__)
+#if !defined(VMS) && !defined(sgi) && !defined(__linux__)
static struct nlist nl[2];
-# endif /* Not VMS or sgi */
+#endif
-# ifdef SUNOS_5
+#ifdef SUNOS_5
static kvm_t *kd;
-# endif /* SUNOS_5 */
+#endif /* SUNOS_5 */
-# endif /* LOAD_AVE_TYPE */
+# endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */
/* Put the 1 minute, 5 minute and 15 minute load averages
into the first NELEM elements of LOADAVG.