1pool_get_pool(3PPOoOoLl)Configuration Manipulation Library Funcptoiooln_sget_pool(3POOL)
2
3
4
6 pool_get_pool, pool_get_resource, pool_query_components,
7 pool_query_pools, pool_query_resources - retrieve resource pool config‐
8 uration elements
9
11 cc [ flag]... file... -lpool [ library... ]
12 #include <pool.h>
13
14 pool_t *pool_get_pool(pool_conf_t *conf, const char *name);
15
16
17 pool_resource_t *pool_get_resource(pool_conf_t *conf
18 const char *type, const char *name);
19
20
21 pool_component_t **pool_query_components(pool_conf_t *conf,
22 uint_t *nelem, pool_value_t **props);
23
24
25 pool_t **pool_query_pools(pool_conf_t *conf, uint_t *nelem,
26 pool_value_t **props);
27
28
29 pool_component_t **pool_query_resources(pool_conf_t *conf,
30 uint_t *nelem, pool_value_t **props);
31
32
34 These functions provide a means for querying the contents of the speci‐
35 fied configuration. The conf argument for each function refers to the
36 target configuration to which the operation applies.
37
38
39 The pool_get_pool() function returns the pool with the given name from
40 the provided configuration.
41
42
43 The pool_get_resource() function returns the resource with the given
44 name and type from the provided configuration.
45
46
47 The pool_query_components() function retrieves all resource components
48 that match the given list of properties. If the list of properties is
49 NULL, all components are returned. The number of elements returned is
50 stored in the location pointed to by nelem. The value returned by
51 pool_query_components() is allocated with malloc(3C) and must be
52 explicitly freed.
53
54
55 The pool_query_pools() function behaves similarly to pool_query_compo‐
56 nents() and returns the list of pools that match the given list of
57 properties. The value returned must be freed by the caller.
58
59
60 The pool_query_resources() function similarly returns the list of
61 resources that match the given list of properties. The return value
62 must be freed by the caller.
63
65 The pool_get_pool() and pool_get_resource() functions return the match‐
66 ing pool and resource, respectively. Otherwise, they return NULL and
67 pool_error(3POOL) returns the pool-specific error value.
68
69
70 The pool_query_components(), pool_query_pools(), and
71 pool_query_resources() functions return a null-terminated array of com‐
72 ponents, pools, and resources, respectively. If the query was unsuc‐
73 cessful or there were no matches, NULL is returned and pool_error()
74 returns the pool-specific error value.
75
77 The pool_get_pool() will fail if:
78
79 POE_BADPARAM The supplied configuration's status is not POF_VALID.
80
81
82
83 The pool_get_resource() will fail if:
84
85 POE_BADPARAM The supplied configuration's status is not POF_VALID.
86
87
88 POE_SYSTEM There is not enough memory available to allocate work‐
89 ing buffers. Check errno for the specific system error
90 code.
91
92
93
94 The pool_query_components(), pool_query_pools(), and
95 pool_query_resources() will fail if:
96
97 POE_BADPARAM The supplied configuration's status is not
98 POF_VALID.
99
100
101 POE_INVALID_CONF The query generated results that were not of the
102 correct type. The configuration is invalid.
103
104
105 POE_SYSTEM There is not enough memory available to allocate
106 working buffers. Check errno for the specific sys‐
107 tem error code.
108
109
111 Example 1 Retrieve the pool named "foo" from a given configuration.
112
113 #include <pool.h>
114 #include <stdio.h>
115
116 ...
117
118 pool_conf_t *conf;
119 pool_t *pool;
120
121 ...
122
123 if ((pool = pool_get_pool(conf, "foo")) == NULL) {
124 (void) fprintf(stderr, "Cannot retrieve pool named
125 'foo'0
126 ...
127 }
128
129
131 See attributes(5) for descriptions of the following attributes:
132
133
134
135
136 ┌─────────────────────────────┬─────────────────────────────┐
137 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
138 ├─────────────────────────────┼─────────────────────────────┤
139 │CSI │Enabled │
140 ├─────────────────────────────┼─────────────────────────────┤
141 │Interface Stability │Unstable │
142 ├─────────────────────────────┼─────────────────────────────┤
143 │MT-Level │Safe │
144 └─────────────────────────────┴─────────────────────────────┘
145
147 libpool(3LIB), pool_error(3POOL), attributes(5)
148
149
150
151SunOS 5.11 18 Jul 2005 pool_get_pool(3POOL)