summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--config.h.in9
-rw-r--r--configure.in1
-rw-r--r--getloadavg.c4
4 files changed, 17 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a75a4a9..d73049d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,9 +2,16 @@ Mon Apr 7 02:06:22 1997 Paul D. Smith <psmith@baynetworks.com>
* Version 3.75.1
- * compatMakefile (objs): Define & use theo $(GLOB) variable so
+ * compatMakefile (objs): Define & use the $(GLOB) variable so
that it's removed correctly from build.sh.in when it's built.
+ * configure.in: On Solaris we can use the kstat_*() functions to
+ get load averages without needing special permissions. Add a
+ check for -lkstat to see if we have it.
+
+ * getloadavg.c (getloadavg): Use HAVE_LIBKSTAT instead of SUN5 as
+ the test to enable kstat_open(), etc. processing.
+
Fri Apr 4 20:21:18 1997 Eli Zaretskii <eliz@is.elta.co.il>
* <lots>: Fixes to work in the DJGPP DOS environment.
diff --git a/config.h.in b/config.h.in
index c1fed49..1f83d84 100644
--- a/config.h.in
+++ b/config.h.in
@@ -38,9 +38,6 @@
/* Define if your system has a working fnmatch function. */
#undef HAVE_FNMATCH
-/* Define if your system has its own `getloadavg' function. */
-#undef HAVE_GETLOADAVG
-
/* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT
@@ -185,6 +182,9 @@
/* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS
+/* Define if you have the getloadavg function. */
+#undef HAVE_GETLOADAVG
+
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
@@ -266,5 +266,8 @@
/* Define if you have the dgc library (-ldgc). */
#undef HAVE_LIBDGC
+/* Define if you have the kstat library (-lkstat). */
+#undef HAVE_LIBKSTAT
+
/* Define if you have the sun library (-lsun). */
#undef HAVE_LIBSUN
diff --git a/configure.in b/configure.in
index 9a35c1a..c6f6583 100644
--- a/configure.in
+++ b/configure.in
@@ -46,6 +46,7 @@ AC_FUNC_ALLOCA
AC_FUNC_VFORK
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_GETLOADAVG
+AC_CHECK_LIB(kstat, kstat_open)
AC_FUNC_STRCOLL
# Check out the wait reality.
diff --git a/getloadavg.c b/getloadavg.c
index be589e7..dba7907 100644
--- a/getloadavg.c
+++ b/getloadavg.c
@@ -541,7 +541,7 @@ getloadavg (loadavg, nelem)
elem = -1;
# endif
-# if !defined (LDAV_DONE) && defined (SUNOS_5)
+# if !defined (LDAV_DONE) && defined (HAVE_LIBKSTAT)
/* Use libkstat because we don't have to be root. */
# define LDAV_DONE
kstat_ctl_t *kc;
@@ -586,7 +586,7 @@ getloadavg (loadavg, nelem)
}
kstat_close (kc);
-# endif /* SUNOS_5 */
+# endif /* HAVE_LIBKSTAT */
# if !defined (LDAV_DONE) && defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
/* Use pstat_getdynamic() because we don't have to be root. */