1getloadavg(3)              Library Functions Manual              getloadavg(3)
2
3
4

NAME

6       getloadavg - get system load averages
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

32       If  the  load  average was unobtainable, -1 is returned; otherwise, the
33       number of samples actually retrieved is returned.
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

STANDARDS

46       BSD.
47

HISTORY

49       4.3BSD-Reno, Solaris.  glibc 2.2.
50

SEE ALSO

52       uptime(1), proc(5)
53
54
55
56Linux man-pages 6.04              2023-03-30                     getloadavg(3)
Impressum