xref: /original-bsd/lib/libc/gen/getloadavg.3 (revision cd89438c)
1.\" Copyright (c) 1989, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)getloadavg.3	6.3 (Berkeley) 04/19/91
7.\"
8.Dd
9.Dt GETLOADAVG 3
10.Os
11.Sh NAME
12.Nm getloadavg
13.Nd get system load averages
14.Sh SYNOPSIS
15.Fn getloadavg "double loadavg[]" "int nelem"
16.Sh DESCRIPTION
17The
18.Fn getloadavg
19function
20returns the number of processes in the system run queue
21averaged over various periods of time.  Up to
22.Fa nelem
23samples are retrieved and assigned to successive elements of
24.Fa loadavg Ns Bq .
25The system imposes a maximum of 3 samples, representing averages
26over the last 1, 5, and 15 minutes, respectively.
27.Sh DIAGNOSTICS
28If the load average was unobtainable, \-1 is returned; otherwise,
29the number of samples actually retrieved is returned.
30.Sh SEE ALSO
31.Xr uptime 1 ,
32.Xr nlist 3 ,
33.Xr kmem 4
34.Sh HISTORY
35The
36.Fn getloadavg
37function is
38.Ud .
39.Sh BUGS
40Programs using this utility must have read permission on
41.Pa /dev/kmem .
42This restriction will eventually be lifted.
43