> Could someone show me some pointers as to how load average
> is calculated in "uptime", or "w"....or sources for "uptime"
Depends on what kind of system you're using. For BSD-derived Unix
boxen, there's an array in the kernel called "avenrun", which is an
array of three floats. Do an nlist() of /vmunix, find "_avenrun",
open /dev/kmem and lseek() to wherever _avenrun is, and read three
floating point numbers. The easiest way to see what I'm talking about
is to look at the source for "w" (which you should be able to get off
the 4.4BSD-Lite distribution).
For SunOS 4.x, you can do this, or I think there is some kvm_* call
you can use to get the info.
--Pat.