]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getloadavg.3
23faa258e42b454dcd09c7962190673f2298bd5b
[thirdparty/man-pages.git] / man3 / getloadavg.3
1 '\" t
2 .\" Copyright (c) 1989, 1991, 1993
3 .\" The Regents of the University of California. All rights reserved.
4 .\"
5 .\" SPDX-License-Identifier: BSD-3-Clause
6 .\"
7 .\" @(#)getloadavg.3 8.1 (Berkeley) 6/4/93
8 .\"
9 .\" 2007-12-08, mtk, Converted from mdoc to man macros
10 .\"
11 .TH getloadavg 3 (date) "Linux man-pages (unreleased)"
12 .SH NAME
13 getloadavg \- get system load averages
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <stdlib.h>
20 .PP
21 .BI "int getloadavg(double " loadavg[] ", int " nelem );
22 .fi
23 .PP
24 .RS -4
25 Feature Test Macro Requirements for glibc (see
26 .BR feature_test_macros (7)):
27 .RE
28 .PP
29 .BR getloadavg ():
30 .nf
31 Since glibc 2.19:
32 _DEFAULT_SOURCE
33 In glibc up to and including 2.19:
34 _BSD_SOURCE
35 .fi
36 .SH DESCRIPTION
37 The
38 .BR getloadavg ()
39 function returns the number of processes in the system run queue
40 averaged over various periods of time.
41 Up to
42 .I nelem
43 samples are retrieved and assigned to successive elements of
44 .IR loadavg[] .
45 The system imposes a maximum of 3 samples, representing averages
46 over the last 1, 5, and 15 minutes, respectively.
47 .SH RETURN VALUE
48 If the load average was unobtainable, \-1 is returned; otherwise,
49 the number of samples actually retrieved is returned.
50 .SH ATTRIBUTES
51 For an explanation of the terms used in this section, see
52 .BR attributes (7).
53 .ad l
54 .nh
55 .TS
56 allbox;
57 lbx lb lb
58 l l l.
59 Interface Attribute Value
60 T{
61 .BR getloadavg ()
62 T} Thread safety MT-Safe
63 .TE
64 .hy
65 .ad
66 .sp 1
67 .SH STANDARDS
68 BSD.
69 .SH HISTORY
70 4.3BSD-Reno, Solaris.
71 glibc 2.2.
72 .SH SEE ALSO
73 .BR uptime (1),
74 .BR proc (5)