1pset_getloadavg(3C) Standard C Library Functions pset_getloadavg(3C)
2
3
4
6 pset_getloadavg - get system load averages for a processor set
7
9 #include <sys/pset.h>
10 #include <sys/loadavg.h>
11
12 int pset_getloadavg(psetid_t pset, double loadavg[], int nelem);
13
14
16 The pset_getloadavg() function returns the number of processes assigned
17 to the specified processor set that are in the system run queue, aver‐
18 aged over various periods of time. Up to nelem samples are retrieved
19 and assigned to successive elements of loadavg[]. The system imposes a
20 maximum of 3 samples, representing averages over the last 1, 5, and 15
21 minutes, respectively.
22
23
24 The LOADAVG_1MIN, LOADAVG_5MIN, and LOADAVG_15MIN indices, defined in
25 <sys/loadavg.h>, can be used to extract the data from the appropriate
26 element of the loadavg[] array.
27
28
29 If pset is PS_NONE, the load average for processes not assigned to a
30 processor set is returned.
31
32
33 If pset is PS_MYID, the load average for the processor set to which the
34 caller is bound is returned. If the caller is not bound to a processor
35 set, the result is the same as if PS_NONE was specified.
36
38 Upon successful completion, the number of samples actually retrieved
39 is returned. If the load average was unobtainable or the processor set
40 does not exist, −1 is returned and errno is set to indicate the error.
41
43 The pset_getloadavg() function will fail if:
44
45 EINVAL The number of elements specified is less than 0, or an
46 invalid processor set ID was specified.
47
48 The caller is in a non-global zone, the pools facility is
49 active, and the specified processor set is not that of the
50 zone's pool.
51
52
54 See attributes(5) for descriptions of the following attributes:
55
56
57
58
59 ┌─────────────────────────────┬─────────────────────────────┐
60 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
61 ├─────────────────────────────┼─────────────────────────────┤
62 │Interface Stability │Stable │
63 ├─────────────────────────────┼─────────────────────────────┤
64 │MT-Level │Async-Signal-Safe │
65 └─────────────────────────────┴─────────────────────────────┘
66
68 uptime(1), w(1), psrset(1M), prstat(1M), pset_bind(2), pset_create(2),
69 Kstat(3PERL), attributes(5)
70
71
72
73SunOS 5.11 28 Jun 2004 pset_getloadavg(3C)