Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 3: Extended Library Functions, Volume 1 Oracle Solaris 11 Express 11/10 |
Extended Library Functions, Volume 1
CIRCLEQ_HEAD_INITIALIZER(3EXT)
cpc_walk_generic_events_all(3CPC)
cpc_walk_generic_events_pic(3CPC)
ct_dev_status_get_aset(3CONTRACT)
ct_dev_status_get_dev_state(3CONTRACT)
ct_dev_status_get_minor(3CONTRACT)
ct_dev_status_get_noneg(3CONTRACT)
ct_dev_tmpl_clear_noneg(3CONTRACT)
ct_dev_tmpl_get_aset(3CONTRACT)
ct_dev_tmpl_get_minor(3CONTRACT)
ct_dev_tmpl_get_noneg(3CONTRACT)
ct_dev_tmpl_set_aset(3CONTRACT)
ct_dev_tmpl_set_minor(3CONTRACT)
ct_dev_tmpl_set_noneg(3CONTRACT)
ct_event_read_critical(3CONTRACT)
ct_pr_event_get_exitstatus(3CONTRACT)
ct_pr_event_get_gcorefile(3CONTRACT)
ct_pr_event_get_pcorefile(3CONTRACT)
ct_pr_event_get_pid(3CONTRACT)
ct_pr_event_get_ppid(3CONTRACT)
ct_pr_event_get_sender(3CONTRACT)
ct_pr_event_get_senderct(3CONTRACT)
ct_pr_event_get_signal(3CONTRACT)
ct_pr_event_get_zcorefile(3CONTRACT)
ct_pr_status_get_contracts(3CONTRACT)
ct_pr_status_get_fatal(3CONTRACT)
ct_pr_status_get_members(3CONTRACT)
ct_pr_status_get_param(3CONTRACT)
ct_pr_status_get_svc_aux(3CONTRACT)
ct_pr_status_get_svc_creator(3CONTRACT)
ct_pr_status_get_svc_fmri(3CONTRACT)
ct_pr_tmpl_get_fatal(3CONTRACT)
ct_pr_tmpl_get_param(3CONTRACT)
ct_pr_tmpl_get_svc_aux(3CONTRACT)
ct_pr_tmpl_get_svc_fmri(3CONTRACT)
ct_pr_tmpl_get_transfer(3CONTRACT)
ct_pr_tmpl_set_fatal(3CONTRACT)
ct_pr_tmpl_set_param(3CONTRACT)
ct_pr_tmpl_set_svc_aux(3CONTRACT)
ct_pr_tmpl_set_svc_fmri(3CONTRACT)
ct_pr_tmpl_set_transfer(3CONTRACT)
ct_status_get_cookie(3CONTRACT)
ct_status_get_critical(3CONTRACT)
ct_status_get_holder(3CONTRACT)
ct_status_get_informative(3CONTRACT)
ct_status_get_nevents(3CONTRACT)
ct_status_get_nevid(3CONTRACT)
ct_status_get_ntime(3CONTRACT)
ct_status_get_qtime(3CONTRACT)
ct_status_get_state(3CONTRACT)
ct_status_get_zoneid(3CONTRACT)
ct_tmpl_get_critical(3CONTRACT)
ct_tmpl_get_informative(3CONTRACT)
ct_tmpl_set_critical(3CONTRACT)
ct_tmpl_set_informative(3CONTRACT)
dat_evd_clear_unwaitable(3DAT)
dat_get_consumer_context(3DAT)
dat_registry_add_provider(3DAT)
dat_registry_list_providers(3DAT)
dat_registry_remove_provider(3DAT)
dat_set_consumer_context(3DAT)
devid_deviceid_to_nmlist(3DEVID)
di_link_next_by_lnode(3DEVINFO)
di_link_next_by_node(3DEVINFO)
di_lnode_private_get(3DEVINFO)
di_lnode_private_set(3DEVINFO)
di_minor_private_get(3DEVINFO)
di_minor_private_set(3DEVINFO)
di_path_client_devfs_path(3DEVINFO)
di_path_client_next_path(3DEVINFO)
di_path_phci_next_path(3DEVINFO)
di_path_prop_lookup_bytes(3DEVINFO)
di_path_prop_lookup_int64s(3DEVINFO)
di_path_prop_lookup_ints(3DEVINFO)
di_path_prop_lookup_strings(3DEVINFO)
di_path_prop_strings(3DEVINFO)
di_prom_prop_lookup_bytes(3DEVINFO)
di_prom_prop_lookup_ints(3DEVINFO)
di_prom_prop_lookup_strings(3DEVINFO)
di_prop_lookup_bytes(3DEVINFO)
di_prop_lookup_int64(3DEVINFO)
di_prop_lookup_strings(3DEVINFO)
ea_match_object_catalog(3EXACCT)
- process contract status functions
cc [ flag… ] file… -D_LARGEFILE64_SOURCE -lcontract [ library… ] #include <libcontract.h> #include <sys/contract/process.h> int ct_pr_status_get_param(ct_stathdl_t stathdl, uint_t *paramp);
int ct_pr_status_get_fatal(ct_stathdl_t stathdl, uint_t *eventsp);
int ct_pr_status_get_members(ct_stathdl_t stathdl, pid_t **pidpp, uint_t *n);
int ct_pr_status_get_contracts(ct_stathdl_t stathdl, ctid_t **idpp, uint_t *n);
int ct_pr_status_get_svc_fmri(ct_stathdl_t stathdl, char **fmri);
int ct_pr_status_get_svc_aux(ct_stathdl_t stathdl, char **aux);
int ct_pr_status_get_svc_ctid(ct_stathdl_t stathdl, ctid_t *ctid);
int ct_pr_status_get_svc_creator(ct_stathdl_t stathdl, char **creator);
These functions read process contract status information from a status object returned by ct_status_read(3CONTRACT).
The ct_pr_status_get_param() function reads the parameter set term. The value is a collection of bits as described in process(4).
The ct_pr_status_get_fatal() function reads the fatal event set term. The value is a collection of bits as described in process(4).
The ct_pr_status_get_members() function obtains a list of the process IDs of the members of the process contract. A pointer to an array of process IDs is stored in *pidpp. The number of elements in this array is stored in *n. These data are freed when the status object is freed by a call to ct_status_free(3CONTRACT).
The ct_pr_status_get_contracts() function obtains a list of IDs of contracts that have been inherited by the contract. A pointer to an array of IDs is stored in *idpp. The number of elements in this array is stored in *n. These data are freed when the status object is freed by a call to ct_status_free().
The ct_pr_status_get_svc_fmri(), ct_pr_status_get_svc_creator(), and ct_pr_status_get_svc_aux() functions read, respectively, the service FMRI, the contract's creator execname and the creator's auxiliary field. The buffer pointed to by fmri, aux or creator, is freed by a call to ct_status_free() and should not be modified.
The ct_pr_status_get_svc_ctid() function reads the process contract id for which the service FMRI was first set.
Upon successful completion, ct_pr_status_get_param(), ct_pr_status_get_fatal(), ct_pr_status_get_members(), ct_pr_status_get_contracts(), ct_pr_status_get_svc_fmri(), ct_pr_status_get_svc_creator(), ct_pr_status_get_svc_aux(), and ct_pr_status_get_svc_ctid() return 0. Otherwise, they return a non-zero error value.
The ct_pr_status_get_param(), ct_pr_status_get_fatal(), ct_pr_status_get_members(), ct_pr_status_get_contracts(), ct_pr_status_get_svc_fmri(), ct_pr_status_get_svc_creator(), ct_pr_status_get_svc_aux(), and ct_pr_status_get_svc_ctid() functions will fail if:
The stathdl argument is not a process contract status object.
The ct_pr_status_get_param(), ct_pr_status_get_fatal(), ct_pr_status_get_members(), ct_r_status_get_contracts(), ct_pr_status_get_svc_fmri(), ct_pr_status_get_svc_creator(), ct_pr_status_get_svc_aux(), and ct_pr_status_get_svc_ctid() functions will fail if:
The requested data were not available in the status object.
Example 1 Print members of process contract 1.
Open the status file for contract 1, read the contract's status, obtain the list of processes, print them, and free the status object.
#include <sys/types.h> #include <fcntl.h> #include <libcontract.h> #include <stdio.h> ... int fd; uint_t i, n; pid_t *procs; ct_stathdl_t st; fd = open("/system/contract/process/1/status"); ct_status_read(fd, &st); ct_pr_status_get_members(st, &procs, &n); for (i = 0 ; i < n; i++) printf("%ld\n", (long)procs[i]); ct_status_free(stat); close(fd); ...
See attributes(5) for descriptions of the following attributes:
|
ct_status_free(3CONTRACT), ct_status_read(3CONTRACT), libcontract(3LIB), contract(4), process(4), attributes(5), lfcompile(5)