1pool_associate(3PPoOoOlL)Configuration Manipulation Library Funpcotoilo_nasssociate(3POOL)
2
3
4
6 pool_associate, pool_create, pool_destroy, pool_dissociate, pool_info,
7 pool_query_pool_resources - resource pool manipulation functions
8
10 cc [ flag... ] file... -lpool [ library... ]
11 #include <pool.h>
12
13 int pool_associate(pool_conf_t *conf, pool_t *pool,
14 pool_resource_t *resource);
15
16
17 pool_t *pool_create(pool_conf_t *conf, const char *name);
18
19
20 int pool_destroy(pool_conf_t *conf, pool_t *pool);
21
22
23 int pool_dissociate(pool_conf_t *conf, pool_t *pool,
24 pool_resource_t *resource);
25
26
27 const char *pool_info(pool_conf_t *conf, pool_t *pool,
28 int flags);
29
30
31 pool_resource_t **pool_query_pool_resources(pool_conf_t *conf,
32 pool_t *pool, uint_t *nelem, pool_value_t **properties);
33
34
36 These functions provide mechanisms for constructing and modifying pools
37 entries within a target pools configuration. The conf argument for
38 each function refers to the target configuration to which the operation
39 applies.
40
41
42 The pool_associate() function associates the specified resource with
43 pool. A resource can be associated with multiple pools at the same
44 time. Any resource of this type that was formerly associated with this
45 pool is no longer associated with the pool. The new association
46 replaces the earlier one.
47
48
49 The pool_create() function creates a new pool with the supplied name
50 with its default properties initialized, and associated with the
51 default resource of each type.
52
53
54 The pool_destroy function() destroys the given pool association. Asso‐
55 ciated resources are not modified.
56
57
58 The pool_dissociate() function removes the association between the
59 given resource and pool. On successful completion, the pool is associ‐
60 ated with the default resource of the same type.
61
62
63 The pool_info() function returns a string describing the given pool.
64 The string is allocated with malloc(3C). The caller is reponsible for
65 freeing the returned string. If the flags option is non-zero, the
66 string returned also describes the associated resources of the pool.
67
68
69 The pool_query_pool_resources() function returns a null-terminated
70 array of resources currently associated with the pool that match the
71 given list of properties. The return value must be freed by the caller.
72 The nelem argument is set to be the length of the array returned.
73
75 Upon successful completion, pool_create() returns a new initialized
76 pool. Otherwise it returns NULL and pool_error(3POOL) returns the pool-
77 specific error value.
78
79
80 Upon successful completion, pool_associate(), pool_destroy(), and
81 pool_dissociate() return 0. Otherwise, they return -1 and pool_error()
82 returns the pool-specific error value.
83
84
85 Upon successful completion, pool_info() returns a string describing the
86 given pool. Otherwise it returns NULL and pool_error() returns the
87 pool-specific error value.
88
89
90 Upon successful completion, pool_query_pool_resources() returns a null-
91 terminated array of resources. Otherwise it returns NULL and
92 pool_error() returns the pool-specific error value.
93
95 The pool_create() function will fail if:
96
97 POE_BADPARAM The supplied configuration's status is not
98 POF_VALID or name is already in use.
99
100
101 POE_SYSTEM A system error has occurred. Check the system error
102 code for more details.
103
104
105 POE_INVALID_CONF The pool element could not be created because the
106 configuration would be invalid.
107
108
109 POE_PUTPROP One of the supplied properties could not be set.
110
111
112
113 The pool_destroy() function will fail if:
114
115 POE_BADPARAM The supplied configuration's status is not POF_VALID.
116
117
118
119 The pool_associate() function will fail if:
120
121 POE_BADPARAM The supplied configuration's status is not POF_VALID or
122 the parameters are supplied from a different configura‐
123 tion.
124
125
126 POE_SYSTEM A system error has occurred. Check the system error
127 code for more details.
128
129
130
131 The pool_disassociate() function will fail if:
132
133 POE_BADPARAM The supplied configuration's status is not
134 POF_VALID or the parameters are supplied from a
135 different configuration.
136
137
138 POE_INVALID_CONF No resources could be located for the supplied con‐
139 figuration or the supplied configuration is not
140 valid (for example, more than one default for a
141 resource type was found.)
142
143
144 POE_SYSTEM A system error has occurred. Check the system error
145 code for more details.
146
147
148
149 The pool_info() function will fail if:
150
151 POE_BADPARAM The supplied configuration's status is not
152 POF_VALID or the flags paramter is neither 0 or 1.
153
154
155 POE_INVALID_CONF The configuration is invalid.
156
157
158 POE_SYSTEM A system error has occurred. Check the system error
159 code for more details.
160
161
162
163 The pool_query_pool_resources() function will fail if:
164
165 POE_BADPARAM The supplied configuration's status is not
166 POF_VALID.
167
168
169 POE_INVALID_CONF The configuration is invalid.
170
171
172 POE_SYSTEM A system error has occurred. Check the system error
173 code for more details.
174
175
177 Pool names are unique across pools in a given configuration file. It is
178 an error to attempt to create a pool with a name that is currently used
179 by another pool within the same configuration.
180
182 See attributes(5) for descriptions of the following attributes:
183
184
185
186
187 ┌─────────────────────────────┬─────────────────────────────┐
188 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
189 ├─────────────────────────────┼─────────────────────────────┤
190 │CSI │Enabled │
191 ├─────────────────────────────┼─────────────────────────────┤
192 │Interface Stability │Unstable │
193 ├─────────────────────────────┼─────────────────────────────┤
194 │MT-Level │Safe │
195 └─────────────────────────────┴─────────────────────────────┘
196
198 libpool(3LIB), pool_error(3POOL), attributes(5)
199
200
201
202SunOS 5.11 18 Jul 2005 pool_associate(3POOL)