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_ASSOCIATE 3POOL "April 9, 2016"
8 pool_associate, pool_create, pool_destroy, pool_dissociate, pool_info,
9 pool_query_pool_resources \- resource pool manipulation functions
13 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpool\fR [ \fIlibrary\fR\&.\|.\|. ]
16 \fBint\fR \fBpool_associate\fR(\fBpool_conf_t *\fR\fIconf\fR, \fB pool_t *\fR\fIpool\fR,
17 \fBpool_resource_t *\fR\fIresource\fR);
22 \fBpool_t *\fR\fBpool_create\fR(\fBpool_conf_t *\fR\fIconf\fR, \fBconst char *\fR\fIname\fR);
27 \fBint\fR \fBpool_destroy\fR(\fBpool_conf_t *\fR\fIconf\fR, \fBpool_t *\fR\fIpool\fR);
32 \fBint\fR \fBpool_dissociate\fR(\fBpool_conf_t *\fR\fIconf\fR, \fBpool_t *\fR\fIpool\fR,
33 \fBpool_resource_t *\fR\fIresource\fR);
38 \fBconst char *\fR\fBpool_info\fR(\fBpool_conf_t *\fR\fIconf\fR, \fBpool_t *\fR\fIpool\fR,
39 \fBint\fR \fIflags\fR);
44 \fBpool_resource_t **\fR\fBpool_query_pool_resources\fR(\fBpool_conf_t *\fR\fIconf\fR,
45 \fBpool_t *\fR\fIpool\fR, \fBuint_t *\fR\fInelem\fR, \fBpool_value_t **\fR\fIproperties\fR);
50 These functions provide mechanisms for constructing and modifying pools entries
51 within a target pools configuration. The \fIconf\fR argument for each function
52 refers to the target configuration to which the operation applies.
55 The \fBpool_associate()\fR function associates the specified resource with
56 \fIpool\fR. A resource can be associated with multiple pools at the same time.
57 Any resource of this type that was formerly associated with this pool is no
58 longer associated with the pool. The new association replaces the earlier one.
61 The \fBpool_create()\fR function creates a new pool with the supplied name with
62 its default properties initialized, and associated with the default resource of
66 The \fBpool_destroy function()\fR destroys the given pool association.
67 Associated resources are not modified.
70 The \fBpool_dissociate()\fR function removes the association between the given
71 resource and pool. On successful completion, the pool is associated with the
72 default resource of the same type.
75 The \fBpool_info()\fR function returns a string describing the given pool. The
76 string is allocated with \fBmalloc\fR(3C). The caller is responsible for freeing
77 the returned string. If the \fIflags\fR option is non-zero, the string returned
78 also describes the associated resources of the pool.
81 The \fBpool_query_pool_resources()\fR function returns a null-terminated array
82 of resources currently associated with the pool that match the given list of
83 properties. The return value must be freed by the caller. The \fInelem\fR
84 argument is set to be the length of the array returned.
87 Upon successful completion, \fBpool_create()\fR returns a new initialized pool.
88 Otherwise it returns \fINULL\fR and \fBpool_error\fR(3POOL) returns the
89 pool-specific error value.
92 Upon successful completion, \fBpool_associate()\fR, \fBpool_destroy()\fR, and
93 \fBpool_dissociate()\fR return 0. Otherwise, they return -1 and
94 \fBpool_error()\fR returns the pool-specific error value.
97 Upon successful completion, \fBpool_info()\fR returns a string describing the
98 given pool. Otherwise it returns \fINULL\fR and \fBpool_error()\fR returns the
99 pool-specific error value.
102 Upon successful completion, \fBpool_query_pool_resources()\fR returns a
103 null-terminated array of resources. Otherwise it returns \fINULL\fR and
104 \fBpool_error()\fR returns the pool-specific error value.
107 The \fBpool_create()\fR function will fail if:
111 \fB\fBPOE_BADPARAM\fR\fR
114 The supplied configuration's status is not \fBPOF_VALID\fR or \fIname\fR is
121 \fB\fBPOE_SYSTEM\fR\fR
124 A system error has occurred. Check the system error code for more details.
130 \fB\fBPOE_INVALID_CONF\fR\fR
133 The pool element could not be created because the configuration would be
140 \fB\fBPOE_PUTPROP\fR\fR
143 One of the supplied properties could not be set.
148 The \fBpool_destroy()\fR function will fail if:
152 \fB\fBPOE_BADPARAM\fR\fR
155 The supplied configuration's status is not \fBPOF_VALID\fR.
160 The \fBpool_associate()\fR function will fail if:
164 \fB\fBPOE_BADPARAM\fR\fR
167 The supplied configuration's status is not \fBPOF_VALID\fR or the parameters
168 are supplied from a different configuration.
174 \fB\fBPOE_SYSTEM\fR\fR
177 A system error has occurred. Check the system error code for more details.
182 The \fBpool_disassociate()\fR function will fail if:
186 \fB\fBPOE_BADPARAM\fR\fR
189 The supplied configuration's status is not \fBPOF_VALID\fR or the parameters
190 are supplied from a different configuration.
196 \fB\fBPOE_INVALID_CONF\fR\fR
199 No resources could be located for the supplied configuration or the supplied
200 configuration is not valid (for example, more than one default for a resource
207 \fB\fBPOE_SYSTEM\fR\fR
210 A system error has occurred. Check the system error code for more details.
215 The \fBpool_info()\fR function will fail if:
219 \fB\fBPOE_BADPARAM\fR\fR
222 The supplied configuration's status is not \fBPOF_VALID\fR or the \fIflags\fR
223 paramter is neither 0 or 1.
229 \fB\fBPOE_INVALID_CONF\fR\fR
232 The configuration is invalid.
238 \fB\fBPOE_SYSTEM\fR\fR
241 A system error has occurred. Check the system error code for more details.
246 The \fBpool_query_pool_resources()\fR function will fail if:
250 \fB\fBPOE_BADPARAM\fR\fR
253 The supplied configuration's status is not \fBPOF_VALID\fR.
259 \fB\fBPOE_INVALID_CONF\fR\fR
262 The configuration is invalid.
268 \fB\fBPOE_SYSTEM\fR\fR
271 A system error has occurred. Check the system error code for more details.
276 Pool names are unique across pools in a given configuration file. It is an
277 error to attempt to create a pool with a name that is currently used by another
278 pool within the same configuration.
281 See \fBattributes\fR(5) for descriptions of the following attributes:
289 ATTRIBUTE TYPE ATTRIBUTE VALUE
293 Interface Stability Unstable
300 \fBlibpool\fR(3LIB), \fBpool_error\fR(3POOL), \fBattributes\fR(5)