1scf_property_creSaetrev(i3cSeCFC)onfiguration Facility LibrarysFcufn_cptrioopnesrty_create(3SCF)
2
3
4
6 scf_property_create, scf_property_handle, scf_property_destroy,
7 scf_property_get_name, scf_property_type, scf_property_is_type,
8 scf_type_to_string, scf_string_to_type, scf_property_get_value,
9 scf_pg_get_property - create and manipulate property handles in the
10 Service Configuration Facility
11
13 cc [ flag... ] file... -lscf [ library... ]
14 #include <libscf.h>
15
16 scf_property_t *scf_property_create(scf_handle_t *handle);
17
18
19 scf_handle_t *scf_property_handle(scf_property_t *prop);
20
21
22 void scf_property_destroy(scf_property_t *prop);
23
24
25 ssize_t scf_property_get_name(const scf_property_t *prop,
26 char *buf, size_t size);
27
28
29 int scf_property_type(const scf_property_t *prop,
30 scf_type_t *type);
31
32
33 int scf_property_is_type(const scf_property_t *prop,
34 scf_type_t type);
35
36
37 const char *scf_type_to_string(scf_type_t type);
38
39
40 scf_type_t scf_string_to_type(const char *type);
41
42
43 int scf_property_get_value(const scf_property_t *prop,
44 scf_value_t *value);
45
46
47 int scf_pg_get_property(const scf_property_t *pg,
48 const char *name, scf_property_t *prop);
49
50
52 Properties are named sets of values of one type. They are grouped into
53 property groups (see scf_pg_create(3SCF)) that are updated atomically
54 using transactions (see scf_transaction_create(3SCF)).
55
56
57 An scf_property_t is an opaque handle that can be set to a single prop‐
58 erty at any given time. When set, it inherits the point-in-time from
59 the source scf_propertygroup_t and does not change until reset.
60
61
62 The scf_property_create() function allocates and initializes a new
63 scf_property_t bound to handle. The scf_property_destroy() function
64 destroys and frees prop.
65
66
67 The scf_property_handle() function returns the handle to which prop is
68 bound.
69
70
71 The scf_property_type() function retrieves the type of the property to
72 which prop is set.
73
74
75 The scf_property_is_type() function determines if the property is com‐
76 patible with type. See scf_value_create(3SCF).
77
78
79 The scf_type_to_string() function returns the string name of the type
80 supplied. If the type is invalid or unknown, it returns "unknown".
81
82
83 The scf_string_to_type() function returns the scf_type_t definition of
84 the string supplied. If the string does not translate to an existing
85 type, it returns SCF_TYPE_INVALID.
86
87
88 The scf_property_get_value() function retrieves the single value that
89 the property to which prop is set contains. If the property has more
90 than one value, the value argument is set to one of the values. To
91 retrieve all values associated with a property, see scf_iter_prop‐
92 erty_values(3SCF).
93
94
95 The scf_pg_get_property() function sets prop to the property specified
96 by name in the property group specified by pg.
97
99 Upon successful completion, scf_property_create() returns a new
100 scf_property_t. Otherwise, it returns NULL.
101
102
103 Upon successful completion, scf_property_get_name() function returns
104 the length of the string written, not including the terminating null
105 byte. Otherwise, it returns -1.
106
107
108 Upon successful completion, scf_pg_get_property(), scf_property_type(),
109 scf_property_is_type(), and scf_pg_get_value() functions return 0. Oth‐
110 erwise, they return -1.
111
112
113 Upon successful completion, scf_type_to_string() returns a string of
114 the type supplied.
115
116
117 Upon successful completion, scf_string_to_type() returns the scf_type_t
118 definition of the string supplied
119
121 The scf_property_create() function will fail if:
122
123 SCF_ERROR_INVALID_ARGUMENT The value of the handle argument is NULL.
124
125
126 SCF_ERROR_NO_MEMORY There is not enough memory to allocate an
127 scf_property_t.
128
129
130 SCF_ERROR_NO_RESOURCES The server does not have adequate
131 resources for a new property handle.
132
133
134
135 The scf_property_handle() function will fail if:
136
137 SCF_ERROR_HANDLE_DESTROYED The handle associated with prop has been
138 destroyed.
139
140
141
142 The scf_property_get_name(), scf_property_type(), scf_prop‐
143 erty_is_type(), and scf_property_get_value() functions will fail if:
144
145 SCF_ERROR_CONNECTION_BROKEN
146
147 The connection to the repository was lost.
148
149
150 SCF_ERROR_DELETED
151
152 The property's parent property group or an ancestor has been
153 deleted.
154
155
156 SCF_ERROR_NOT_BOUND
157
158 The handle was never bound or has been unbound.
159
160
161 SCF_ERROR_NOT_SET
162
163 The property is not set.
164
165
166
167 The scf_property_is_type() function will fail if:
168
169 SCF_ERROR_INVALID_ARGUMENT The type argument is not a valid type.
170
171
172 SCF_ERROR_TYPE_MISMATCH The prop argument is not of a type com‐
173 patible with type.
174
175
176
177 The scf_pg_get_property() function will fail if:
178
179 SCF_ERROR_BACKEND_ACCESS
180
181 The storage mechanism that the repository server (svc.con‐
182 figd(1M)) chose for the operation denied access.
183
184
185 SCF_ERROR_CONNECTION_BROKEN
186
187 The connection to the repository was lost.
188
189
190 SCF_ERROR_DELETED
191
192 The property group or an ancestor has been deleted.
193
194
195 SCF_ERROR_HANDLE_MISMATCH
196
197 The property group and property are not derived from the same han‐
198 dle.
199
200
201 SCF_ERROR_INTERNAL
202
203 An internal error occurred.
204
205
206 SCF_ERROR_INVALID_ARGUMENT
207
208 The value of the name argument is not a valid property name.
209
210
211 SCF_ERROR_NO_RESOURCES
212
213 The server does not have the resources to complete the request.
214
215
216 SCF_ERROR_NOT_BOUND
217
218 The handle was never bound or has been unbound.
219
220
221 SCF_ERROR_NOT_FOUND
222
223 The property specified by name was not found.
224
225
226 SCF_ERROR_NOT_SET
227
228 The property group specified by pg is not set.
229
230
231
232 The scf_property_get_value() function will fail if:
233
234 SCF_ERROR_CONSTRAINT_VIOLATED
235
236 The property has more than one value associated with it. The value
237 argument will be set to one of the values.
238
239
240 SCF_ERROR_HANDLE_MISMATCH
241
242 The property and value are derived from different handles.
243
244
245 SCF_ERROR_NOT_FOUND
246
247 The property has no values associated with it. The value argument
248 will be reset.
249
250
251 SCF_ERROR_PERMISSION_DENIED
252
253 The value could not be read due to access restrictions.
254
255
256
257 The scf_error(3SCF) function can be used to retrieve the error value.
258
260 See attributes(5) for descriptions of the following attributes:
261
262
263
264
265 ┌─────────────────────────────┬─────────────────────────────┐
266 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
267 ├─────────────────────────────┼─────────────────────────────┤
268 │Interface Stability │Committed │
269 ├─────────────────────────────┼─────────────────────────────┤
270 │MT-Level │Safe │
271 └─────────────────────────────┴─────────────────────────────┘
272
274 libscf(3LIB), scf_error(3SCF), scf_handle_decode_fmri(3SCF),
275 scf_iter_property_values(3SCF), scf_pg_create(3SCF), scf_prop‐
276 erty_to_fmri(3SCF), scf_transaction_create(3SCF), scf_value_cre‐
277 ate(3SCF), attributes(5)
278
279
280
281SunOS 5.11 28 Oct 2008 scf_property_create(3SCF)