Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Nov 1996 18:02:58 -0800 (PST)
From:      asami@freebsd.org (Satoshi Asami)
To:        joerg_wunsch@uriah.heep.sax.de
Cc:        jmz@freebsd.org, ports@freebsd.org, rich@freebsd.org
Subject:   Re: XFree86 contrib
Message-ID:  <199611090202.SAA03500@vader.cs.berkeley.edu>
In-Reply-To: <199611082113.WAA06830@uriah.heep.sax.de> (message from J Wunsch on Fri, 8 Nov 1996 22:13:29 %2B0100 (MET))

next in thread | previous in thread | raw e-mail | index | archive | help
 * I'm not Rich... anyway, this already came up in the XFree86 beta
 * group.  It's definately _not_ a kmem access problem, but rather that
 * xload is apparently built using the wrong options.  It's not supposed
 * to access /dev/kmem, but should use getloadavg(3) instead (which in
 * turn uses sysctl(3)).

Ok -- thanks for the hint.  I waded my way through the spaghetti of
#ifdef's and finally came up with this patch:

======
--- ./programs/xload/get_load.c.org	Sat Oct 26 01:19:56 1996
+++ ./programs/xload/get_load.c	Fri Nov  8 17:52:09 1996
@@ -489,6 +489,8 @@
 static kvm_t *kd;
 static int fscale;
 
+#ifdef __bsdi__
+
 void InitLoadPoint()
 {
   fixpt_t averunnable[3];  /* unused really */
@@ -979,6 +981,7 @@
 #endif /* sun else */
 	return;
 }
+#endif /* __bsdi__ else */
 #endif /* BSD >= 199306 else */
 #endif /* CSRG_BASED else */
 #endif /* __osf__ else */
=======

(Hey don't laugh, it took me half an hour to make this thing compile.)
It seems to work fine for me now.

Please check it, I'm not sure what BSDi does (I assumed the missing
#ifdef was BSDi's, because there was a "#else /* __bsdi__ */" in
the middle...)...

Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611090202.SAA03500>