Given an FMRI and a property name (pg/name), I'm trying to retrieve a string value.
It appears to me that this requires approximately 10 libscf calls, not counting error handling: h = scf_handle_create(SCF_VERSION); scf_handle_bind(h); prop = scf_property_create(h); sprintf(buf, "%s/:properties/%s", fmri, propname); scf_handle_decode_fmri(h, buf, NULL, NULL, NULL, NULL, prop, SCF_DECODE_FMRI_EXACT); value = scf_value_create(h); scf_property_get_value(prop, value); scf_value_get_astring(value, buf, sizeof (buf)); scf_value_destroy(value); scf_property_destroy(prop); scf_handle_destroy(h); Is there a simpler way? Alternatively, is there anything missing from that sequence? (And no, popen("svcprop ...", "r") is not an acceptable alternative.)