1GETLOADAVG(3)              Linux Programmer's Manual             GETLOADAVG(3)
2
3
4

NAME

6       getloadavg - get system load averages
7

SYNOPSIS

9       #include <stdlib.h>
10
11       int getloadavg(double loadavg[], int nelem);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       getloadavg():
16           Since glibc 2.19:
17               _DEFAULT_SOURCE
18           In glibc up to and including 2.19:
19               _BSD_SOURCE
20

DESCRIPTION

22       The getloadavg() function returns the number of processes in the system
23       run queue averaged over various periods of time.  Up to  nelem  samples
24       are  retrieved  and  assigned to successive elements of loadavg[].  The
25       system imposes a maximum of 3 samples, representing averages  over  the
26       last 1, 5, and 15 minutes, respectively.
27

RETURN VALUE

29       If  the  load  average was unobtainable, -1 is returned; otherwise, the
30       number of samples actually retrieved is returned.
31

VERSIONS

33       This function is available in glibc since version 2.2.
34

ATTRIBUTES

36       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
37       tributes(7).
38
39       ┌────────────────────────────────────────────┬───────────────┬─────────┐
40Interface                                   Attribute     Value   
41       ├────────────────────────────────────────────┼───────────────┼─────────┤
42getloadavg()                                │ Thread safety │ MT-Safe │
43       └────────────────────────────────────────────┴───────────────┴─────────┘
44

CONFORMING TO

46       Not in POSIX.1.  Present on the BSDs and Solaris.
47

SEE ALSO

49       uptime(1), proc(5)
50

COLOPHON

52       This  page  is  part of release 5.13 of the Linux man-pages project.  A
53       description of the project, information about reporting bugs,  and  the
54       latest     version     of     this    page,    can    be    found    at
55       https://www.kernel.org/doc/man-pages/.
56
57
58
59Linux                             2021-03-22                     GETLOADAVG(3)
Impressum