'\" t .\" Copyright 1989-1993, The Regents of the University of California. .\" Copyright, The contributors to the Linux man-pages project .\" .\" SPDX-License-Identifier: BSD-3-Clause .\" .TH getloadavg 3 2025-05-06 "Linux man-pages 6.14" .SH NAME getloadavg \- get system load averages .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) .SH SYNOPSIS .nf .B #include .P .BI "int getloadavg(double " loadavg[] ", int " n ); .fi .P .RS -4 Feature Test Macro Requirements for glibc (see .BR feature_test_macros (7)): .RE .P .BR getloadavg (): .nf Since glibc 2.19: _DEFAULT_SOURCE In glibc up to and including 2.19: _BSD_SOURCE .fi .SH DESCRIPTION The .BR getloadavg () function returns the number of processes in the system run queue averaged over various periods of time. Up to .I n samples are retrieved and assigned to successive elements of .IR loadavg[] . The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively. .SH RETURN VALUE If the load average was unobtainable, \-1 is returned; otherwise, the number of samples actually retrieved is returned. .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). .TS allbox; lbx lb lb l l l. Interface Attribute Value T{ .na .nh .BR getloadavg () T} Thread safety MT-Safe .TE .SH STANDARDS BSD. .SH HISTORY 4.3BSD-Reno, Solaris. glibc 2.2. .SH SEE ALSO .BR uptime (1), .BR proc (5)