1pool_get_propertPyo(o3lPOCOoLn)figuration Manipulation LibrarypFouonlc_tgieotn_sproperty(3POOL)
2
3
4
6 pool_get_property, pool_put_property, pool_rm_property, pool_walk_prop‐
7 erties - resource pool element property manipulation
8
10 cc [ flag... ] file... -lpool [ library... ]
11 #include <pool.h>
12
13 pool_value_class_t pool_get_property(pool_conf_t *conf,
14 const pool_elem_t *elem, const char *name,
15 pool_value_t *property);
16
17
18 int pool_put_property(pool_conf_t *conf, pool_elem_t *elem,
19 const char *name, const pool_value_t *value);
20
21
22 int pool_rm_property(pool_conf_t *conf, pool_elem_t *elem,
23 const char *name);
24
25
26 int pool_walk_properties(pool_conf_t *conf, pool_elem_t *elem,
27 void *arg, int (*callback)(pool_conf_t *, pool_elem_t *,
28 const char *, pool_value_t *, void *));
29
30
32 The various pool types are converted to the common pool element type
33 (pool_elem_t) before property manipulation. A pool_value_t is an opaque
34 type that contains a property value of one of the following types:
35
36 POC_UINT unsigned 64-bit integer
37
38
39 POC_INT signed 64-bit integer
40
41
42 POC_DOUBLE signed double-precision floating point value
43
44
45 POC_BOOL boolean value: 0 is false, non-zero is true
46
47
48 POC_STRING null-terminated string of characters
49
50
51
52 The conf argument for each function refers to the target configuration
53 to which the operation applies.
54
55
56 The pool_get_property() function attempts to retrieve the value of the
57 named property from the element. If the property is not found or an
58 error occurs, the value POC_INVAL is returned to indicate error. Other‐
59 wise the type of the value retrieved is returned.
60
61
62 The pool_put_property() function attempts to set the named property on
63 the element to the specified value. Attempting to set a property that
64 does not currently exist on the element will cause the property with
65 the given name and value to be created on the element and will not
66 cause an error. An attempt to overwrite an existing property with a new
67 property of a different type is an error.
68
69
70 The pool_rm_property() function attempts to remove the named property
71 from the element. If the property does not exist or is not removable,
72 -1 is returned and pool_error(3POOL) reporst an error of POE_PUTPROP.
73
74
75 The pool_walk_properties() function invokes callback on all properties
76 defined for the given element. The callback is called with the element
77 itself, the name of the property, the value of the property, and the
78 caller-provided opaque argument.
79
80
81 A number of special properties are reserved for internal use and cannot
82 be set or removed. Attempting to do so will fail. These properties are
83 documented on the libpool(3LIB) manual page.
84
86 Upon successful completion, pool_get_property() returns the type of the
87 property. Otherwise it returns POC_INVAL and pool_error() returns the
88 pool-specific error value.
89
90
91 Upon successful completion, pool_put_property(), pool_rm_property(),
92 and pool_walk_properties() return 0. Otherwise they return −1 and
93 pool_error() returns the pool-specific error value.
94
96 The pool_get_property() function will fail if:
97
98 POE_BADPARAM The supplied configuration's status is not POF_VALID,
99 the supplied conf does not contain the supplied elem,
100 or the property is restricted and cannot be accessed by
101 the library.
102
103
104 POE_SYSTEM A system error has occurred. Check the system error
105 code for more details.
106
107
108
109 The pool_put_property() function will fail if:
110
111 POE_BADPARAM The supplied configuration's status is not
112 POF_VALID, the supplied conf does not contain the
113 supplied elem, the property name is not in the cor‐
114 rect format, or the property already exists and the
115 supplied type does not match the existing type.
116
117
118 POE_SYSTEM A system error has occurred. Check the system error
119 code for more details.
120
121
122 POE_PUTPROP The property name is reserved by libpool and not
123 available for use.
124
125
126 POE_INVALID_CONF The configuration is invalid.
127
128
129
130 The pool_rm_property() function will fail if:
131
132 POE_BADPARAM The supplied configuration's status is not POF_VALID,
133 the supplied conf does not contain the supplied elem,
134 or the property is reserved by libpool and cannot be
135 removed.
136
137
138 POE_SYSTEM A system error has occurred. Check the system error
139 code for more details.
140
141
142 POE_PUTPROP The property name is reserved by libpool and not avail‐
143 able for use.
144
145
146
147 The pool_walk_properties() function will fail if:
148
149 POE_BADPARAM The supplied configuration's status is not POF_VALID.
150
151
152 POE_SYSTEM A system error has occurred. Check the system error
153 code for more details.
154
155
157 See attributes(5) for descriptions of the following attributes:
158
159
160
161
162 ┌─────────────────────────────┬─────────────────────────────┐
163 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
164 ├─────────────────────────────┼─────────────────────────────┤
165 │CSI │Enabled │
166 ├─────────────────────────────┼─────────────────────────────┤
167 │Interface Stability │Unstable │
168 ├─────────────────────────────┼─────────────────────────────┤
169 │MT-Level │Safe │
170 └─────────────────────────────┴─────────────────────────────┘
171
173 libpool(3LIB), pool_error(3POOL), attributes(5)
174
175
176
177SunOS 5.11 23 Sep 2003 pool_get_property(3POOL)