1*61111Sbostic.\" Copyright (c) 1989, 1991, 1993 2*61111Sbostic.\" The Regents of the University of California. All rights reserved. 338181Smckusick.\" 443566Strent.\" %sccs.include.redist.man% 538181Smckusick.\" 6*61111Sbostic.\" @(#)getloadavg.3 8.1 (Berkeley) 06/04/93 738181Smckusick.\" 848349Scael.Dd 948349Scael.Dt GETLOADAVG 3 1048349Scael.Os 1148349Scael.Sh NAME 1248349Scael.Nm getloadavg 1348349Scael.Nd get system load averages 1448349Scael.Sh SYNOPSIS 1548349Scael.Fn getloadavg "double loadavg[]" "int nelem" 1648349Scael.Sh DESCRIPTION 1748349ScaelThe 1848349Scael.Fn getloadavg 1959369Sbosticfunction returns the number of processes in the system run queue 2059369Sbosticaveraged over various periods of time. 2159369SbosticUp to 2248349Scael.Fa nelem 2338181Smckusicksamples are retrieved and assigned to successive elements of 2448349Scael.Fa loadavg Ns Bq . 2538181SmckusickThe system imposes a maximum of 3 samples, representing averages 2638181Smckusickover the last 1, 5, and 15 minutes, respectively. 2748349Scael.Sh DIAGNOSTICS 2838181SmckusickIf the load average was unobtainable, \-1 is returned; otherwise, 2938181Smckusickthe number of samples actually retrieved is returned. 3048349Scael.Sh SEE ALSO 3148349Scael.Xr uptime 1 , 3259369Sbostic.Xr sysctl 2 , 3359369Sbostic.Xr kvm_getloadavg 3 3448349Scael.Sh HISTORY 3548349ScaelThe 3648349Scael.Fn getloadavg 3755518Sbosticfunction appeared in 3855518Sbostic.Bx 4.3 Reno . 39