58 caller.
59
60
61 The pool_query_resources() function similarly returns the list of
62 resources that match the given list of properties. The return value
63 must be freed by the caller.
64
65 RETURN VALUES
66 The pool_get_pool() and pool_get_resource() functions return the
67 matching pool and resource, respectively. Otherwise, they return NULL
68 and pool_error(3POOL) returns the pool-specific error value.
69
70
71 The pool_query_components(), pool_query_pools(), and
72 pool_query_resources() functions return a null-terminated array of
73 components, pools, and resources, respectively. If the query was
74 unsuccessful or there were no matches, NULL is returned and
75 pool_error() returns the pool-specific error value.
76
77 ERRORS
78 The pool_get_pool() will fail if:
79
80 POE_BADPARAM
81 The supplied configuration's status is not POF_VALID.
82
83
84
85 The pool_get_resource() will fail if:
86
87 POE_BADPARAM
88 The supplied configuration's status is not POF_VALID.
89
90
91 POE_SYSTEM
92 There is not enough memory available to allocate
93 working buffers. Check errno for the specific system
94 error code.
95
96
97
98 The pool_query_components(), pool_query_pools(), and
99 pool_query_resources() will fail if:
100
101 POE_BADPARAM
102 The supplied configuration's status is not
103 POF_VALID.
104
105
106 POE_INVALID_CONF
107 The query generated results that were not of the
108 correct type. The configuration is invalid.
109
110
111 POE_SYSTEM
112 There is not enough memory available to allocate
113 working buffers. Check errno for the specific
114 system error code.
115
116
117 EXAMPLES
118 Example 1 Retrieve the pool named "foo" from a given configuration.
119
120 #include <pool.h>
121 #include <stdio.h>
122
123 ...
124
125 pool_conf_t *conf;
126 pool_t *pool;
127
128 ...
129
130 if ((pool = pool_get_pool(conf, "foo")) == NULL) {
131 (void) fprintf(stderr, "Cannot retrieve pool named
132 'foo'\B{}n");
133 ...
134 }
135
136
137 ATTRIBUTES
138 See attributes(5) for descriptions of the following attributes:
139
140
141
142
143 +--------------------+-----------------+
144 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
145 +--------------------+-----------------+
146 |CSI | Enabled |
147 +--------------------+-----------------+
148 |Interface Stability | Unstable |
149 +--------------------+-----------------+
150 |MT-Level | Safe |
151 +--------------------+-----------------+
152
153 SEE ALSO
154 libpool(3LIB), pool_error(3POOL), attributes(5)
155
156
157
158 July 18, 2005 POOL_GET_POOL(3POOL)
|
58 caller.
59
60
61 The pool_query_resources() function similarly returns the list of
62 resources that match the given list of properties. The return value
63 must be freed by the caller.
64
65 RETURN VALUES
66 The pool_get_pool() and pool_get_resource() functions return the
67 matching pool and resource, respectively. Otherwise, they return NULL
68 and pool_error(3POOL) returns the pool-specific error value.
69
70
71 The pool_query_components(), pool_query_pools(), and
72 pool_query_resources() functions return a null-terminated array of
73 components, pools, and resources, respectively. If the query was
74 unsuccessful or there were no matches, NULL is returned and
75 pool_error() returns the pool-specific error value.
76
77 ERRORS
78 The pool_get_pool() function will fail if:
79
80 POE_BADPARAM
81 The supplied configuration's status is not POF_VALID.
82
83
84
85 The pool_get_resource() function will fail if:
86
87 POE_BADPARAM
88 The supplied configuration's status is not POF_VALID.
89
90
91 POE_SYSTEM
92 There is not enough memory available to allocate
93 working buffers. Check errno for the specific system
94 error code.
95
96
97
98 The pool_query_components(), pool_query_pools(), and
99 pool_query_resources() functions will fail if:
100
101 POE_BADPARAM
102 The supplied configuration's status is not
103 POF_VALID.
104
105
106 POE_INVALID_CONF
107 The query generated results that were not of the
108 correct type. The configuration is invalid.
109
110
111 POE_SYSTEM
112 There is not enough memory available to allocate
113 working buffers. Check errno for the specific
114 system error code.
115
116
117 EXAMPLES
118 Example 1 Retrieve the pool named "foo" from a given configuration.
119
120 #include <pool.h>
121 #include <stdio.h>
122
123 ...
124
125 pool_conf_t *conf;
126 pool_t *pool;
127
128 ...
129
130 if ((pool = pool_get_pool(conf, "foo")) == NULL) {
131 (void) fprintf(stderr, "Cannot retrieve pool named
132 'foo'\n");
133 ...
134 }
135
136
137 ATTRIBUTES
138 See attributes(5) for descriptions of the following attributes:
139
140
141
142
143 +--------------------+-----------------+
144 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
145 +--------------------+-----------------+
146 |CSI | Enabled |
147 +--------------------+-----------------+
148 |Interface Stability | Unstable |
149 +--------------------+-----------------+
150 |MT-Level | Safe |
151 +--------------------+-----------------+
152
153 SEE ALSO
154 libpool(3LIB), pool_error(3POOL), attributes(5)
155
156
157
158 January 18, 2020 POOL_GET_POOL(3POOL)
|