nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3lgrp / lgrp_resources.3lgrp
blobd0307bdbc23a942de97586c59d655468ed66b20b
1 '\" te
2 .\" Copyright (c) 2005, 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 LGRP_RESOURCES 3LGRP "Jan 26, 2005"
7 .SH NAME
8 lgrp_resources \- get lgroup resources of given lgroup
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ]
13 #include <sys/lgrp_user.h>
15 \fBint\fR \fBlgrp_resources\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIlgrp\fR,
16      \fBlgrp_id_t *\fR\fIlgrpids\fR, \fBuint_t\fR \fIcount\fR, \fBlgrp_rsrc_t\fR \fItype\fR);
17 .fi
19 .SH DESCRIPTION
20 .sp
21 .LP
22 The \fBlgrp_resources()\fR function takes a  cookie  representing  a snapshot
23 of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and returns the
24 number of resources in the lgroup specified by \fIlgrp\fR.  The resources are
25 represented by a set of lgroups in which each lgroup directly contains CPU
26 and/or memory resources.
27 .sp
28 .LP
29 The \fItype\fR argument should be set to one of the following values to specify
30 whether the CPU or memory resources should be returned:
31 .sp
32 .in +2
33 .nf
34 LGRP_RSRC_CPU      /* CPU resources */
35 LGRP_RSRC_MEM      /* Memory resources */
36 .fi
37 .in -2
39 .sp
40 .LP
41 If the \fIlgrpids\fR[] argument is non-null and the \fIcount\fR argument is
42 non-zero, \fBlgrp_resources()\fR stores up to the specified count of lgroup IDs
43 into the \fIlgrpids\fR[] array.
44 .SH RETURN VALUES
45 .sp
46 .LP
47 Upon  successful  completion,  \fBlgrp_resources()\fR returns the number  of
48 lgroup resources. Otherwise, -1 is returned and \fBerrno\fR is set to indicate
49 the error.
50 .SH ERRORS
51 .sp
52 .LP
53 The \fBlgrp_resources()\fR function will fail if:
54 .sp
55 .ne 2
56 .na
57 \fB\fBEINVAL\fR\fR
58 .ad
59 .RS 10n
60 The specified cookie, lgroup  ID, or type is not valid.
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fBESRCH\fR\fR
67 .ad
68 .RS 10n
69 The specified lgroup ID was not found.
70 .RE
72 .SH ATTRIBUTES
73 .sp
74 .LP
75 See \fBattributes\fR(5) for descriptions of the following attributes:
76 .sp
78 .sp
79 .TS
80 box;
81 c | c
82 l | l .
83 ATTRIBUTE TYPE  ATTRIBUTE VALUE
85 Interface Stability     Evolving
87 MT-Level        MT-Safe
88 .TE
90 .SH SEE ALSO
91 .sp
92 .LP
93 \fBlgrp_children\fR(3LGRP), \fBlgrp_init\fR(3LGRP), \fBlgrp_parents\fR(3LGRP),
94 \fBliblgrp\fR(3LIB), \fBattributes\fR(5)