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 POOL_WALK_COMPONENTS 3POOL "Jul 18, 2005"
8 pool_walk_components, pool_walk_pools, pool_walk_resources \- walk objects
9 within resource pool configurations
13 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpool\fR [ \fIlibrary\fR\&.\|.\|. ]
16 \fBint\fR \fBpool_walk_components\fR(\fBpool_conf_t *\fR\fIconf\fR,
17 \fBpool_resource_t *\fR\fIresource\fR, \fBvoid *\fR\fIarg\fR,
18 \fBint (*\fR\fIcallback\fR)(\fBpool_conf_t *\fR, \fBpool_resource_t *\fR, \fBvoid *\fR));
23 \fBint\fR \fBpool_walk_pools\fR(\fBpool_conf_t *\fR\fIconf\fR, \fBvoid *\fR\fIarg\fR,
24 \fBint (*\fR\fIcallback\fR)(\fBpool_conf_t *\fR, \fBpool_component_t *\fR, \fBvoid *\fR));
29 \fBint\fR \fBpool_walk_resources\fR(\fBpool_conf_t *\fR\fIconf\fR, \fBpool_t *\fR\fIpool\fR,
30 \fBvoid *\fR\fIarg\fR, \fBint (*\fR\fIcallback\fR)(\fBpool_conf_t *\fR,
31 \fBpool_component_t *\fR, \fBvoid *\fR));
37 The walker functions provided with \fBlibpool\fR(3LIB) visit each associated
38 entity of the given type, and call the caller-provided \fIcallback\fR function
39 with a user-provided additional opaque argument. There is no implied order of
40 visiting nodes in the walk. If the \fIcallback\fR function returns a non-zero
41 value at any of the nodes, the walk is terminated, and an error value of -1
42 returned. The \fIconf\fR argument for each function refers to the target
43 configuration to which the operation applies.
46 The \fBpool_walk_components()\fR function invokes \fIcallback\fR on all
47 components contained in the resource.
50 The \fBpool_walk_pools()\fR function invokes \fIcallback\fR on all pools
51 defined in the configuration.
54 The \fBpool_walk_resources()\fR function invokes \fIcallback\fR function on all
55 resources associated with \fIpool\fR.
59 Upon successful completion of the walk, these functions return 0. Otherwise -1
60 is returned and \fBpool_error\fR(3POOL) returns the pool-specific error value.
64 These functions will fail if:
68 \fB\fBPOE_BADPARAM\fR\fR
71 The supplied configuration's status is not \fBPOF_VALID\fR.
77 \fB\fBPOE_INVALID_CONF\fR\fR
80 The configuration is invalid.
86 \fB\fBPOE_SYSTEM\fR\fR
89 A system error has occurred. Check the system error code for more details.
95 See \fBattributes\fR(5) for descriptions of the following attributes:
103 ATTRIBUTE TYPE ATTRIBUTE VALUE
107 Interface Stability Unstable
115 \fBlibpool\fR(3LIB), \fBpool_error\fR(3POOL), \fBattributes\fR(5)