1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / pset_getloadavg.3c
blob372a42086ea2dd06e702b7ee8921d29e7fc7846a
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PSET_GETLOADAVG 3C "Jun 28, 2004"
7 .SH NAME
8 pset_getloadavg \- get system load averages for a processor set
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/pset.h>
13 #include <sys/loadavg.h>
15 \fBint\fR \fBpset_getloadavg\fR(\fBpsetid_t\fR \fIpset\fR, \fBdouble\fR \fIloadavg\fR[\|], \fBint\fR \fInelem\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fBpset_getloadavg()\fR function returns the number of processes assigned
22 to the specified processor set that are in the system run queue, averaged over
23 various periods of time.  Up to \fInelem\fR samples are retrieved and assigned
24 to successive elements of \fIloadavg\fR[\|].  The system imposes a maximum of 3
25 samples, representing averages over the last 1, 5, and 15 minutes,
26 respectively.
27 .sp
28 .LP
29 The \fBLOADAVG_1MIN\fR, \fBLOADAVG_5MIN\fR, and \fBLOADAVG_15MIN\fR indices,
30 defined  in <\fBsys/loadavg.h\fR>, can be used to extract the data from the
31 appropriate element of the \fIloadavg\fR[\|] array.
32 .sp
33 .LP
34 If pset is \fBPS_NONE\fR, the load average for processes not assigned to a
35 processor set is returned.
36 .sp
37 .LP
38 If pset is \fBPS_MYID\fR, the load average for the processor set to which the
39 caller is bound is returned.  If the caller is not bound to a processor set,
40 the result is the same as if \fBPS_NONE\fR was specified.
41 .SH RETURN VALUES
42 .sp
43 .LP
44 Upon successful completion, the number of samples  actually retrieved is
45 returned. If the load average was unobtainable or the processor set does not
46 exist, \(mi1 is returned and \fBerrno\fR is set to indicate the error.
47 .SH ERRORS
48 .sp
49 .LP
50 The \fBpset_getloadavg()\fR function will fail if:
51 .sp
52 .ne 2
53 .na
54 \fB\fBEINVAL\fR\fR
55 .ad
56 .RS 10n
57 The number of elements specified is less than 0, or an invalid processor set ID
58 was specified.
59 .sp
60 The caller is in a non-global zone, the pools facility is active, and the
61 specified processor set is not that of the zone's pool.
62 .RE
64 .SH ATTRIBUTES
65 .sp
66 .LP
67 See \fBattributes\fR(5) for descriptions of the following attributes:
68 .sp
70 .sp
71 .TS
72 box;
73 c | c
74 l | l .
75 ATTRIBUTE TYPE  ATTRIBUTE VALUE
77 Interface Stability     Stable
79 MT-Level        Async-Signal-Safe
80 .TE
82 .SH SEE ALSO
83 .sp
84 .LP
85 \fBuptime\fR(1), \fBw\fR(1), \fBpsrset\fR(1M), \fBprstat\fR(1M),
86 \fBpset_bind\fR(2), \fBpset_create\fR(2), \fBKstat\fR(3PERL),
87 \fBattributes\fR(5)