Lines Matching defs:pg
429 scf_propertygroup_t *pg = scf_pg_create(h);
436 if (h == NULL || pg == NULL) {
448 if (scf_instance_get_pg_composed(inst, NULL, pgname, pg) ==
461 if (scf_instance_get_pg_composed(inst, NULL, pgname, pg) ==
472 scf_pg_destroy(pg);
507 libscf_read_state(const scf_propertygroup_t *pg, const char *prop_name,
515 h = scf_pg_handle(pg);
518 if (scf_pg_get_property(pg, prop_name, prop) == -1) {
547 libscf_read_states(const scf_propertygroup_t *pg,
552 state_ret = libscf_read_state(pg, SCF_PROPERTY_STATE, state);
553 next_state_ret = libscf_read_state(pg, SCF_PROPERTY_NEXT_STATE,
590 depgroup_empty(scf_handle_t *h, scf_propertygroup_t *pg)
600 if (scf_iter_pg_properties(iter, pg) != SCF_SUCCESS) {
623 depgroup_read_scheme(scf_handle_t *h, scf_propertygroup_t *pg)
631 if (scf_pg_get_property(pg, SCF_PROPERTY_TYPE, prop) == -1 ||
651 depgroup_read_grouping(scf_handle_t *h, scf_propertygroup_t *pg)
657 if (scf_pg_get_property(pg, SCF_PROPERTY_GROUPING, prop) == -1 ||
681 depgroup_read_restart(scf_handle_t *h, scf_propertygroup_t *pg)
687 if (scf_pg_get_property(pg, SCF_PROPERTY_RESTART_ON, prop) == -1 ||
716 * ECANCELED - pg was deleted
723 get_boolean(scf_propertygroup_t *pg, const char *propname, uint8_t *valuep)
731 h = scf_pg_handle(pg);
735 if (scf_pg_get_property(pg, propname, prop) != 0) {
816 libscf_get_info_events_all(scf_propertygroup_t *pg)
821 if (get_boolean(pg, INFO_EVENTS_ALL, &v) == 0) {
839 * ECANCELED - pg was deleted
846 get_count(scf_propertygroup_t *pg, const char *propname, uint64_t *valuep)
853 h = scf_pg_handle(pg);
857 if (scf_pg_get_property(pg, propname, prop) != 0) {
940 get_restarter(scf_handle_t *h, scf_propertygroup_t *pg, char **restarter)
944 if (scf_pg_get_property(pg, SCF_PROPERTY_RESTARTER, prop) == -1 ||
1050 scf_propertygroup_t *pg;
1054 pg = safe_scf_pg_create(h);
1056 if (scf_instance_get_pg_composed(inst, NULL, SCF_PG_DEATHROW, pg) !=
1061 scf_pg_destroy(pg);
1065 scf_pg_destroy(pg);
1078 switch (r = get_boolean(pg,
1086 scf_pg_destroy(pg);
1099 scf_pg_destroy(pg);
1118 scf_propertygroup_t *pg;
1122 pg = safe_scf_pg_create(h);
1127 if (scf_instance_get_pg_composed(inst, NULL, SCF_PG_GENERAL_OVR, pg) !=
1132 scf_pg_destroy(pg);
1136 scf_pg_destroy(pg);
1149 switch (r = get_boolean(pg, SCF_PROPERTY_ENABLED, &enabled_8)) {
1156 scf_pg_destroy(pg);
1178 if (scf_instance_get_pg_composed(inst, NULL, SCF_PG_GENERAL, pg) != 0) {
1179 scf_pg_destroy(pg);
1196 switch (r = get_boolean(pg, SCF_PROPERTY_ENABLED, &enabled_8)) {
1203 scf_pg_destroy(pg);
1228 get_restarter(h, pg, restarter_fmri);
1230 scf_pg_destroy(pg);
1236 * Sets pg to the name property group of s_inst. If it doesn't exist, it is
1248 const char *type, uint32_t flags, scf_propertygroup_t *pg)
1253 if (scf_instance_get_pg(inst, name, pg) == 0) {
1254 if (scf_pg_get_flags(pg, &f) != 0) {
1271 if (scf_pg_delete(pg) != 0) {
1313 if (scf_instance_add_pg(inst, name, type, flags, pg) == 0)
1408 * ECANCELED - pg was deleted
1414 pg_set_prop_value(scf_propertygroup_t *pg, const char *pname, scf_value_t *v)
1423 h = scf_pg_handle(pg);
1431 if (scf_transaction_start(tx, pg) != 0) {
1510 if (scf_pg_update(pg) == -1) {
1550 scf_propertygroup_t *pg = NULL;
1555 pg = safe_scf_pg_create(h);
1558 ret = libscf_inst_get_or_add_pg(inst, pgname, pgtype, pgflags, pg);
1576 ret = pg_set_prop_value(pg, pname, v);
1591 scf_pg_destroy(pg);
1611 scf_propertygroup_t *pg = NULL;
1616 pg = safe_scf_pg_create(h);
1619 ret = libscf_inst_get_or_add_pg(inst, pgname, pgtype, pgflags, pg);
1637 ret = pg_set_prop_value(pg, pname, v);
1652 scf_pg_destroy(pg);
1696 * ECANCELED - pg was deleted
1697 * ENOENT - pg has no milestone property
1701 pg_get_milestone(scf_propertygroup_t *pg, scf_property_t *prop,
1704 if (scf_pg_get_property(pg, SCF_PROPERTY_MILESTONE, prop) != 0) {
1765 scf_propertygroup_t *pg;
1768 pg = safe_scf_pg_create(scf_instance_handle(inst));
1770 if (scf_instance_get_pg(inst, SCF_PG_OPTIONS_OVR, pg) == 0) {
1771 switch (r = pg_get_milestone(pg, prop, val, buf, buf_sz)) {
1805 if (scf_instance_get_pg(inst, SCF_PG_OPTIONS, pg) == 0) {
1806 r = pg_get_milestone(pg, prop, val, buf, buf_sz);
1830 scf_pg_destroy(pg);
1903 libscf_clear_runlevel(scf_propertygroup_t *pg, const char *milestone)
1913 h = scf_pg_handle(pg);
1925 if (scf_transaction_start(tx, pg) != 0) {
2032 if (scf_pg_update(pg) == -1) {
2074 scf_propertygroup_t *pg = NULL;
2083 pg = safe_scf_pg_create(h);
2090 if (scf_instance_get_pg_composed(inst, snap, SCF_PG_TM_COMMON_NAME, pg)
2116 if (scf_pg_get_property(pg, st->st_locale, prop) == -1) {
2149 if (scf_pg_get_property(pg, "C", prop) == -1) {
2186 scf_pg_destroy(pg);
2208 scf_propertygroup_t *pg = NULL;
2215 pg = safe_scf_pg_create(h);
2221 if (scf_instance_get_pg_composed(inst, snap, SCF_PG_STARTD, pg) == -1) {
2246 if (scf_pg_get_property(pg, SCF_PROPERTY_DURATION, prop) == -1) {
2283 if (scf_pg_get_property(pg, SCF_PROPERTY_UTMPX_PREFIX, prop) == 0) {
2316 scf_pg_destroy(pg);
2332 scf_propertygroup_t *pg = NULL;
2342 pg = safe_scf_pg_create(h);
2346 if (scf_instance_get_pg(inst, SCF_PG_RESTARTER, pg) == -1) {
2365 ret = get_count(pg, SCF_PROPERTY_CONTRACT, &p);
2391 ret = get_count(pg, SCF_PROPERTY_TRANSIENT_CONTRACT, &t);
2418 ret = get_count(pg, SCF_PROPERTY_START_PID, &p);
2446 scf_pg_destroy(pg);
2466 scf_propertygroup_t *pg;
2471 pg = safe_scf_pg_create(h);
2477 SCF_PG_RESTARTER_TYPE, SCF_PG_RESTARTER_FLAGS, pg);
2495 ret = pg_set_prop_value(pg, SCF_PROPERTY_START_PID, v_pid);
2514 scf_pg_destroy(pg);
2538 scf_propertygroup_t *pg;
2544 pg = safe_scf_pg_create(h);
2555 SCF_PG_RESTARTER_TYPE, SCF_PG_RESTARTER_FLAGS, pg);
2578 ret = pg_set_prop_value(pg, propname, v);
2593 scf_pg_destroy(pg);
2617 scf_propertygroup_t *pg;
2628 pg = safe_scf_pg_create(h);
2637 SCF_PG_RESTARTER_TYPE, SCF_PG_RESTARTER_FLAGS, pg);
2661 if (scf_transaction_start(tx, pg) != 0) {
2761 if (scf_pg_update(pg) == -1) {
2784 scf_pg_destroy(pg);
2862 scf_propertygroup_t *pg = NULL, *pg_startd = NULL;
2872 pg = safe_scf_pg_create(h);
2904 if (scf_instance_get_pg_composed(scf_inst, snap, name, pg) == -1) {
2912 if (scf_pg_get_property(pg, SCF_PROPERTY_EXEC, prop) == -1) {
2936 r = get_count(pg, SCF_PROPERTY_TIMEOUT, timeout);
3065 if (scf_pg_get_property(pg, SCF_PROPERTY_RESTART_ON, prop) == -1) {
3095 scf_pg_destroy(pg);
3138 libscf_unset_action(scf_handle_t *h, scf_propertygroup_t *pg,
3154 if (scf_pg_update(pg) == -1) {
3170 if (scf_transaction_start(t, pg) == -1) {
3198 if (scf_pg_get_property(pg, admin_actions[a], prop) == -1) {
3408 scf_propertygroup_t *pg;
3414 pg = safe_scf_pg_create(h);
3421 scf_pg_destroy(pg);
3440 r = scf_iter_next_pg(iter, pg);
3445 scf_pg_destroy(pg);
3464 r = cb(pg, arg);
3471 scf_pg_destroy(pg);
3854 scf_propertygroup_t *pg;
3859 pg = safe_scf_pg_create(h);
3903 scf_pg_destroy(pg);