xref: /csrg-svn/lib/libc/gen/getloadavg.3 (revision 48349)
1*48349Scael.\" Copyright (c) 1989, 1991 The Regents of the University of California.
238181Smckusick.\" All rights reserved.
338181Smckusick.\"
443566Strent.\" %sccs.include.redist.man%
538181Smckusick.\"
6*48349Scael.\"     @(#)getloadavg.3	6.3 (Berkeley) 04/19/91
738181Smckusick.\"
8*48349Scael.Dd
9*48349Scael.Dt GETLOADAVG 3
10*48349Scael.Os
11*48349Scael.Sh NAME
12*48349Scael.Nm getloadavg
13*48349Scael.Nd get system load averages
14*48349Scael.Sh SYNOPSIS
15*48349Scael.Fn getloadavg "double loadavg[]" "int nelem"
16*48349Scael.Sh DESCRIPTION
17*48349ScaelThe
18*48349Scael.Fn getloadavg
19*48349Scaelfunction
2038181Smckusickreturns the number of processes in the system run queue
2138181Smckusickaveraged over various periods of time.  Up to
22*48349Scael.Fa nelem
2338181Smckusicksamples are retrieved and assigned to successive elements of
24*48349Scael.Fa loadavg Ns Bq .
2538181SmckusickThe system imposes a maximum of 3 samples, representing averages
2638181Smckusickover the last 1, 5, and 15 minutes, respectively.
27*48349Scael.Sh DIAGNOSTICS
2838181SmckusickIf the load average was unobtainable, \-1 is returned; otherwise,
2938181Smckusickthe number of samples actually retrieved is returned.
30*48349Scael.Sh SEE ALSO
31*48349Scael.Xr uptime 1 ,
32*48349Scael.Xr nlist 3 ,
33*48349Scael.Xr kmem 4
34*48349Scael.Sh HISTORY
35*48349ScaelThe
36*48349Scael.Fn getloadavg
37*48349Scaelfunction is
38*48349Scael.Ud .
39*48349Scael.Sh BUGS
4038181SmckusickPrograms using this utility must have read permission on
41*48349Scael.Pa /dev/kmem .
4238181SmckusickThis restriction will eventually be lifted.
43