9330 stack overflow when creating a deeply nested dataset
[unleashed.git] / usr / src / man / man3pool / pool_walk_components.3pool
blob27d8387aaeff772ff58815989eb374f96acfc2d2
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 POOL_WALK_COMPONENTS 3POOL "Jul 18, 2005"
7 .SH NAME
8 pool_walk_components, pool_walk_pools, pool_walk_resources \- walk objects
9 within resource pool configurations
10 .SH SYNOPSIS
11 .LP
12 .nf
13 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpool\fR [ \fIlibrary\fR\&.\|.\|. ]
14 #include <pool.h>
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));
19 .fi
21 .LP
22 .nf
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));
25 .fi
27 .LP
28 .nf
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));
32 .fi
34 .SH DESCRIPTION
35 .sp
36 .LP
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.
44 .sp
45 .LP
46 The \fBpool_walk_components()\fR function invokes \fIcallback\fR on all
47 components contained in the resource.
48 .sp
49 .LP
50 The \fBpool_walk_pools()\fR function invokes \fIcallback\fR on all pools
51 defined in the configuration.
52 .sp
53 .LP
54 The \fBpool_walk_resources()\fR function invokes \fIcallback\fR function on all
55 resources associated with \fIpool\fR.
56 .SH RETURN VALUES
57 .sp
58 .LP
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.
61 .SH ERRORS
62 .sp
63 .LP
64 These functions will fail if:
65 .sp
66 .ne 2
67 .na
68 \fB\fBPOE_BADPARAM\fR\fR
69 .ad
70 .RS 20n
71 The supplied configuration's status is not \fBPOF_VALID\fR.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fBPOE_INVALID_CONF\fR\fR
78 .ad
79 .RS 20n
80 The configuration is invalid.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fBPOE_SYSTEM\fR\fR
87 .ad
88 .RS 20n
89 A system error has occurred. Check the system error code for more details.
90 .RE
92 .SH ATTRIBUTES
93 .sp
94 .LP
95 See \fBattributes\fR(5) for descriptions of the following attributes:
96 .sp
98 .sp
99 .TS
100 box;
101 c | c
102 l | l .
103 ATTRIBUTE TYPE  ATTRIBUTE VALUE
105 CSI     Enabled
107 Interface Stability     Unstable
109 MT-Level        Safe
112 .SH SEE ALSO
115 \fBlibpool\fR(3LIB), \fBpool_error\fR(3POOL), \fBattributes\fR(5)