Skip Navigation Links | |
Exit Print View | |
man pages section 3: Extended Library Functions, Volume 4 Oracle Solaris 11.1 Information Library |
Extended Library Functions, Volume 4
gl_customize_completion(3TECLA)
scf_count_ranges_destroy(3SCF)
scf_decoration_get_bundle(3SCF)
scf_decoration_get_layer(3SCF)
scf_decoration_get_value(3SCF)
scf_decoration_layer_from_string(3SCF)
scf_decoration_layer_to_string(3SCF)
scf_entry_destroy_children(3SCF)
scf_instance_get_decoration(3SCF)
scf_instance_get_pg_composed(3SCF)
scf_instance_get_snapshot(3SCF)
scf_instance_is_complete(3SCF)
scf_iter_decoration_values(3SCF)
scf_iter_instance_decorations(3SCF)
scf_iter_instance_pgs_composed(3SCF)
scf_iter_instance_pgs_typed(3SCF)
scf_iter_instance_pgs_typed_composed(3SCF)
scf_iter_instance_snapshots(3SCF)
scf_iter_next_decoration(3SCF)
scf_iter_property_decorations(3SCF)
scf_iter_property_values(3SCF)
scf_iter_service_decorations(3SCF)
scf_iter_service_instances(3SCF)
scf_iter_service_pgs_typed(3SCF)
scf_iter_snaplevel_pgs_typed(3SCF)
scf_pg_get_parent_instance(3SCF)
scf_pg_get_parent_service(3SCF)
scf_pg_get_parent_snaplevel(3SCF)
scf_property_get_decoration(3SCF)
scf_property_get_value_at_layer(3SCF)
scf_service_add_instance(3SCF)
scf_service_get_decoration(3SCF)
scf_service_get_instance(3SCF)
scf_simple_app_props_free(3SCF)
scf_simple_app_props_get(3SCF)
scf_simple_app_props_next(3SCF)
scf_simple_app_props_search(3SCF)
scf_simple_prop_next_astring(3SCF)
scf_simple_prop_next_boolean(3SCF)
scf_simple_prop_next_count(3SCF)
scf_simple_prop_next_integer(3SCF)
scf_simple_prop_next_opaque(3SCF)
scf_simple_prop_next_reset(3SCF)
scf_simple_prop_next_time(3SCF)
scf_simple_prop_next_ustring(3SCF)
scf_simple_prop_numvalues(3SCF)
scf_simple_walk_instances(3SCF)
scf_snaplevel_get_instance_name(3SCF)
scf_snaplevel_get_next_snaplevel(3SCF)
scf_snaplevel_get_parent(3SCF)
scf_snaplevel_get_scope_name(3SCF)
scf_snaplevel_get_service_name(3SCF)
scf_snapshot_get_base_snaplevel(3SCF)
scf_tmpl_error_prop_tmpl(3SCF)
scf_tmpl_error_source_fmri(3SCF)
scf_tmpl_prop_cardinality(3SCF)
scf_tmpl_prop_common_name(3SCF)
scf_tmpl_prop_description(3SCF)
scf_tmpl_prop_internal_seps(3SCF)
scf_tmpl_prop_visibility(3SCF)
scf_tmpl_value_common_name(3SCF)
scf_tmpl_value_count_range_choices(3SCF)
scf_tmpl_value_count_range_constraints(3SCF)
scf_tmpl_value_description(3SCF)
scf_tmpl_value_in_constraint(3SCF)
scf_tmpl_value_int_range_choices(3SCF)
scf_tmpl_value_int_range_constraints(3SCF)
scf_tmpl_value_name_choices(3SCF)
scf_tmpl_value_name_constraints(3SCF)
scf_tmpl_visibility_to_string(3SCF)
scf_transaction_destroy_children(3SCF)
scf_transaction_property_change(3SCF)
scf_transaction_property_change_type(3SCF)
scf_transaction_property_delete(3SCF)
scf_transaction_property_new(3SCF)
scf_transaction_reset_all(3SCF)
scf_value_get_as_string_typed(3SCF)
scf_value_set_from_string(3SCF)
stmfCheckHostGroupInUse(3STMF)
stmfCheckTargetGroupInUse(3STMF)
stmfFreeViewResourceList(3STMF)
stmfGetHostGroupMembers(3STMF)
stmfGetLogicalUnitProperties(3STMF)
stmfGetProviderDataProt(3STMF)
stmfGetTargetGroupMembers(3STMF)
stmfGetTargetProperties(3STMF)
stmfGetViewLuNumberList(3STMF)
stmfGetViewResourceList(3STMF)
stmfRemoveFromHostGroup(3STMF)
stmfRemoveFromTargetGroup(3STMF)
stmfSetProviderDataProt(3STMF)
sysevent_bind_handle(3SYSEVENT)
sysevent_get_attr_list(3SYSEVENT)
sysevent_get_class_name(3SYSEVENT)
sysevent_get_pub_name(3SYSEVENT)
sysevent_get_subclass_name(3SYSEVENT)
sysevent_get_vendor_name(3SYSEVENT)
sysevent_post_event(3SYSEVENT)
sysevent_subscribe_event(3SYSEVENT)
sysevent_unbind_handle(3SYSEVENT)
sysevent_unsubscribe_event(3SYSEVENT)
volmgt_feature_enabled(3VOLMGT)
XTSOLgetClientAttributes(3XTSOL)
XTSOLgetPropAttributes(3XTSOL)
XTSOLgetWorkstationOwner(3XTSOL)
XTSOLsetWorkstationOwner(3XTSOL)
zs_pset_zone_get_pset(3ZONESTAT)
zs_pset_zone_get_zone(3ZONESTAT)
zs_pset_zone_property(3ZONESTAT)
zs_pset_zone_used_cpus(3ZONESTAT)
zs_pset_zone_used_pct(3ZONESTAT)
zs_pset_zone_used_time(3ZONESTAT)
zs_resource_property(3ZONESTAT)
zs_resource_total_time(3ZONESTAT)
zs_resource_total_uint64(3ZONESTAT)
zs_resource_used_pct(3ZONESTAT)
zs_resource_used_time(3ZONESTAT)
zs_resource_used_uint64(3ZONESTAT)
zs_resource_used_zone_pct(3ZONESTAT)
zs_resource_used_zone_time(3ZONESTAT)
zs_resource_used_zone_uint64(3ZONESTAT)
zs_zone_limit_uint64(3ZONESTAT)
zs_zone_limit_used_pct(3ZONESTAT)
zs_zone_limit_used_time(3ZONESTAT)
- create and manipulate property group handles and property groups in the Service Configuration Facility
cc [ flag… ] file… -lscf [ library… ] #include <libscf.h> scf_propertygroup_t *scf_pg_create(scf_handle_t *handle);
scf_handle_t *scf_pg_handle(scf_propertygroup_t *pg);
void scf_pg_destroy(scf_propertygroup_t *pg);
int scf_pg_get_parent_service(const scf_propertygroup_t *pg, scf_service_t *svc);
int scf_pg_get_parent_instance(const scf_propertygroup_t *pg, scf_instance_t *inst);
int scf_pg_get_parent_snaplevel(const scf_propertygroup_t *pg, scf_snaplevel_t *level);
ssize_t scf_pg_get_name(const scf_propertygroup_t *pg, char *buf, size_t size);
ssize_t scf_pg_get_type(const scf_propertygroup_t *pg, char *buf, size_t size);
int scf_pg_get_flags(const scf_propertygroup_t *pg, uint32_t *out);
int scf_pg_update(const scf_propertygroup_t *pg);
int scf_service_get_pg(const scf_service_t *svc, const char *name, scf_propertygroup_t *pg);
int scf_service_add_pg(const scf_service_t *svc, const char *name, const char *group_type, uint32_t flags, scf_propertygroup_t *pg);
int scf_instance_get_pg(const scf_instance_t *inst, const char *name, scf_propertygroup_t *pg);
int scf_instance_get_pg_composed(const scf_instance_t *inst, const scf_snapshot_t *snapshot, const char *name, scf_propertygroup_t *pg);
int scf_instance_add_pg(const scf_instance_t *inst, const char *name, const char *group_type, uint32_t flags, scf_propertygroup_t *pg);
int scf_snaplevel_get_pg(const scf_snaplevel_t *level, const char *name, scf_propertygroup_t *pg);
int scf_pg_delete(scf_propertygroup_t *pg);
int scf_pg_get_underlying_pg(const scf_propertygroup_t *pg, scf_propertygroup_t *out);
Property groups are an atomically-updated group of typed properties. Property groups of services (see scf_service_create(3SCF)) or instances (see scf_instance_create(3SCF)) are modifiable. Property groups of snaplevels (see scf_snaplevel_create(3SCF)) are not modifiable.
An scf_propertygroup_t is an opaque handle that can be set to a single property group at any given time. When an scf_propertygroup_t is set, it references a frozen-in-time version of the property group to which it is set. Updates to the property group will not be visible until either scf_pg_update() is called or the property group is set again.
This static view is propagated to the scf_property_ts set to children of the property group. They will not see updates, even if the scf_propertygroup_t is updated.
The scf_pg_create() function allocates and initializes a new scf_propertygroup_t bound to handle. The scf_pg_destroy() function destroys and frees pg.
The scf_pg_handle() function retrieves the handle to which pg is bound.
The scf_pg_get_parent_service(), scf_pg_get_parent_instance(), and scf_pg_get_parent_snaplevel() functions retrieve the property group's parent, if it is of the requested type.
The scf_pg_get_name() and scf_pg_get_type() functions retrieve the name and type, respectively, of the property group to which pg is set.
The scf_pg_get_flags() function retrieves the flags for the property group to which pg is set. If SCF_PG_FLAG_NONPERSISTENT is set, the property group is not included in snapshots and will lose its contents upon system shutdown or reboot. Non-persistent property groups are mainly used for smf-internal state. See smf(5).
The scf_pg_update() function ensures that pg is attached to the most recent version of the pg to which it is set.
The scf_service_get_pg(), scf_instance_get_pg(), and scf_snaplevel_get_pg() functions set pg to the property group specified by name in the service specified by svc, the instance specified by inst, or the snaplevel specified by level, respectively.
The scf_instance_get_pg_composed() function sets pg to the property group specified by name in the composed view of inst at the time snapshot was taken. If snapshot is NULL, the current properties are used. The composed view of an instance's properties is the union of the properties of the instance and its ancestors. Properties of the instance take precedence over properties of the service with the same name (including the property group name). After a successful call to scf_instance_get_pg_composed(), the parent of pg might not be inst, and the parents of properties obtained from pg might not be pg. If inst and its parent have property groups with the same name but different types, the properties in the property group of the parent are excluded.
The scf_service_add_pg() and scf_instance_add_pg() functions create a new property group specified by name whose type is group_type, and attach the pg handle (if non-null) to the new object. The flags argument must be either 0 or SCF_PG_FLAG_NONPERSISTENT.
The scf_pg_delete() function deletes the property group. Versions of the property group in snapshots are not affected.
The scf_pg_get_underlying_pg() function gets the first existing underlying property group. If the property group specified by pg is an instance property group, out is set to the property group of the same name in the instance's parent.
Applications can use a transaction to modify a property group. See scf_transaction_create(3SCF).
Upon successful completion, scf_pg_create() returns a new scf_propertygroup_t. Otherwise, it returns NULL.
Upon successful completion, scf_pg_handle() returns a pointer to the handle to which pg is bound. Otherwise, it returns NULL.
Upon successful completion, scf_instance_handle() returns the handle instance with which it is associated. Otherwise, it returns NULL.
Upon successful completion, scf_pg_get_name() and scf_pg_get_type() return the length of the string written, not including the terminating null byte. Otherwise, they return -1.
The scf_pg_update() function returns 1 if the object was updated, 0 if the object was already up to date, and -1 on failure.
Upon successful completion, scf_pg_get_parent_service(), scf_pg_get_parent_snaplevel(), scf_pg_get_flags(), scf_service_get_pg(), scf_service_add_pg(), scf_pg_get_parent_instance(), scf_instance_get_pg(), scf_instance_get_pg_composed(), scf_instance_add_pg(), scf_snaplevel_get_pg(), scf_pg_delete(), and scf_pg_get_underlying_pg() return 0. Otherwise, they return -1.
The scf_pg_create() function will fail if:
The handle argument is NULL.
There is not enough memory to allocate an scf_propertygroup_t.
The server does not have adequate resources for a new property group handle.
The scf_pg_handle() function will fail if:
The handle associated with pg has been destroyed.
The scf_pg_update() function will fail if:
The connection to the repository was lost.
An ancestor of the property group specified by pg has been deleted.
An internal error occurred. This can happen if pg has been corrupted.
The pg argument refers to an invalid scf_propertygroup_t.
The handle is not bound.
The property group specified by pg is not set.
The scf_service_get_pg(), scf_instance_get_pg(), scf_instance_get_pg_composed(), scf_snaplevel_get_pg(), and scf_pg_get_underlying_pg() functions will fail if:
The storage mechanism that the repository server (svc.configd(1M)) chose for the operation denied access.
An internal error occurred.
The server does not have the resources to complete the request.
The scf_pg_get_name(), scf_pg_get_type(), scf_pg_get_flags(), scf_pg_get_parent_service(), scf_pg_get_parent_snaplevel(), and scf_pg_get_parent_instance() functions will fail if:
The property group specified by pg has been deleted.
The property group specified by pg is not set.
The handle is not bound.
The connection to the repository was lost.
The scf_pg_get_parent_service(), scf_pg_get_parent_snaplevel(), and scf_pg_get_parent_instance() functions will fail if:
The requested parent type does not match the actual type of the parent of the property group specified by pg.
The property group and either the instance, the service, or the snaplevel are not derived from the same handle.
The scf_instance_get_pg(), scf_instance_get_pg_composed(), scf_service_get_pg(), scf_pg_get_underlying_pg(), and scf_snaplevel_get_pg() functions will fail if:
The property group specified by name was not found.
The scf_service_add_pg(), scf_service_get_pg(), scf_instance_add_pg(), scf_instance_get_pg(), scf_instance_get_pg_composed(), and scf_snaplevel_get_pg() functions will fail if:
The service or instance has been deleted.
The instance is not set.
The value of the name argument is not a valid property group name.
The property group and either the instance, the service, or the level are not derived from the same handle.
The handle is not bound.
The connection to the repository was lost.
The scf_service_add_pg() and scf_instance_add_pg() functions will fail if:
The caller does not have permission to create the requested property group.
The repository backend is read-only.
The repository backend refused the modification.
A {service,instance,property group} named name already exists.
The server does not have the resources to complete the request.
The scf_pg_delete() function will fail if:
The repository backend refused the modification.
The repository backend is read-only.
The connection to the repository was lost.
The property group has been deleted by someone else.
The server does not have adequate resources for a new property group handle.
The property group has not been set.
The caller does not have permission to delete this property group.
The scf_pg_get_underlying_pg() function will fail if:
The connection to the repository was lost.
A required constraint was not met.
The property group has been deleted.
The property group and out are not derived from the same handle.
An argument is invalid.
The handle is not bound.
The property group has not been set.
The scf_error(3SCF) function can be used to retrieve the error value.
Example 1 Perform a layered lookup of name in pg.
int layered_lookup(scf_propertygroup_t *pg, const char *name, scf_property_t *out) { scf_handle_t *handle = scf_pg_handle(out); scf_propertygroup_t *new_pg; scf_propertygroup_t *cur, *other; int state = 0; if (handle == NULL) { return (-1); } new_pg = scf_pg_create(handle); if (new_pg == NULL) { return (-1); } for (;;) { cur = state ? pg : new_pg; other = state ? new_pg : pg; state = !state; if (scf_pg_get_property(cur, name, out) != -1) { scf_pg_destroy(new_pg); return (SUCCESS); } if (scf_pg_get_underlying_pg(cur, other) == -1) break; } scf_pg_destroy(new_pg); return (NOT_FOUND); }
See attributes(5) for descriptions of the following attributes:
|
libscf(3LIB), scf_error(3SCF), scf_handle_decode_fmri(3SCF), scf_instance_create(3SCF), scf_pg_to_fmri(3SCF), scf_service_create(3SCF), scf_snaplevel_create(3SCF), scf_transaction_create(3SCF), attributes(5), smf(5)