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.5 (Berkeley) 04/27/93 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.Fd #include <sys/resource.h> 16.Fn getloadavg "double loadavg[]" "int nelem" 17.Sh DESCRIPTION 18The 19.Fn getloadavg 20function returns the number of processes in the system run queue 21averaged over various periods of time. 22Up to 23.Fa nelem 24samples are retrieved and assigned to successive elements of 25.Fa loadavg Ns Bq . 26The system imposes a maximum of 3 samples, representing averages 27over the last 1, 5, and 15 minutes, respectively. 28.Sh DIAGNOSTICS 29If the load average was unobtainable, \-1 is returned; otherwise, 30the number of samples actually retrieved is returned. 31.Sh SEE ALSO 32.Xr uptime 1 , 33.Xr sysctl 2 , 34.Xr kvm_getloadavg 3 35.Sh HISTORY 36The 37.Fn getloadavg 38function appeared in 39.Bx 4.3 Reno . 40