Skip Navigation Links | |
Exit Print View | |
man pages section 3: Extended Library Functions, Volume 1 Oracle Solaris 11.1 Information Library |
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_ctid(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)
- control libcpc error reporting
cc [ flag… ] file… -lcpc [ library… ] #include <libcpc.h> typedef void(cpc_errhndlr_t)(cpc_t *cpc, const char *fn, int subcode, const char *fmt, va_list ap);
void cpc_seterrhndlr(cpc_t *cpc, cpc_errhndlr_t *errfn);
For the convenience of programmers instrumenting their code, several libcpc(3LIB) functions automatically emit to stderr error messages that attempt to provide a more detailed explanation of their error return values. While this can be useful for simple programs, some applications might wanat to report their errors differently, for example, to a window or to a log file.
The cpc_seterrhndlr() function allows the caller to provide an alternate function for reporting errors. The type signature is shown in the SYNOPSIS. The fn argument is passed the library function name that detected the error, an integer subcode indicating the specific error condidtion that has occurred, and the format string fmt that contains a textual description of the integer subcode. The format string fmt and argument pointer ap can be passed directly to vsnprintf(3C) or similar varargs-based function for formatting.
The integer subcodes are provided to allow programs to recognize error conditions while using libcpc. The fmt string is provided as a convenience for easy printing. The error subcodes are:
A specified event is not supported by the processor.
The counter number does not fall in the range of available counters.
A specified attribute is not supported by the processor.
The value of an attribute is outside the range supported by the processor.
A hardware resource necessary for completing an operation was unavailable.
The requested counter cannot count an assigned event.
One or more requests has invalid flags.
The requests in a set cannot be programmed onto the hardware at the same time.
A request contains an attribute which requires the cpc_cpu privilege, which the process does not have.
The default printing routine can be restored by calling the routine with an errfn argument of NULL.
Example 1 Debugging example.
The following example produces error messages only when debugging the program containing it, or when the cpc_bind_curlwp(), cpc_bind_cpu(), or cpc_bind_pctx() functions are reporting an error when binding a cpc_set_t.
int debugging; void myapp_errfn(const char *fn, int subcode, const char *fmt, va_list ap) { if (strncmp(fn, "cpc_bind", 8) != 0 && !debugging) return; (void) fprintf(stderr, "myapp: cpc_%s(): ", fn); (void) vfprintf(stderr, fmt, ap); }
See attributes(5) for descriptions of the following attributes:
|
cpc_bind_curlwp(3CPC), libcpc(3LIB), vsnprintf(3C), attributes(5)