Subject: hacked xload to use getloadavg, interest?
To: None <current-users@NetBSD.ORG>
From: Jari Kokko <jkokko@snakemail.hut.fi>
List: current-users
Date: 03/23/1996 16:56:27
I read somewhere, that I can't now find, that it would be worthwhile
to have an xload that uses getloadavg. Well, since I couldn't find it,
I did it myself: This is the whole magnificent source file get_load.c,
tested under 1.1, Sun3/60:
#include <X11/Xos.h>
#include <X11/Intrinsic.h>
void InitLoadPoint() /* getloadavg version
*/
{
return;
}
void GetLoadPoint( w, closure, call_data ) /* getloadavg version
*/
Widget w; /* unused */
caddr_t closure; /* unused */
caddr_t call_data; /* pointer to (double) return value */
{
double averages[2];
getloadavg(averages, 2);
*((double *)call_data)=averages[1]; /* five minute avg */
}
Jari Kokko
--QAA15378.827592895/snake.hut.fi--