Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 3: Extended Library Functions Oracle Solaris 10 8/11 Information Library |
Extended Library Functions - Part 1
Extended Library Functions - Part 2
Extended Library Functions - Part 3
Extended Library Functions - Part 4
MP_GetAssociatedPathOidList(3MPAPI)
MP_GetAssociatedPluginOid(3MPAPI)
MP_GetAssociatedTPGOidList(3MPAPI)
MP_GetDeviceProductOidList(3MPAPI)
MP_GetDeviceProductProperties(3MPAPI)
MP_GetInitiatorPortOidList(3MPAPI)
MP_GetInitiatorPortProperties(3MPAPI)
MP_GetLibraryProperties(3MPAPI)
MP_GetMPLogicalUnitProperties(3MPAPI)
MP_GetMPLuOidListFromTPG(3MPAPI)
MP_GetPathLogicalUnitProperties(3MPAPI)
MP_GetPluginProperties(3MPAPI)
MP_GetProprietaryLoadBalanceOidList(3MPAPI)
MP_GetProprietaryLoadBalanceProperties(3MPAPI)
MP_GetTargetPortGroupProperties(3MPAPI)
MP_GetTargetPortOidList(3MPAPI)
MP_GetTargetPortProperties(3MPAPI)
MP_RegisterForObjectPropertyChanges(3MPAPI)
MP_RegisterForObjectVisibilityChanges(3MPAPI)
MP_SetFailbackPollingRate(3MPAPI)
MP_SetLogicalUnitLoadBalanceType(3MPAPI)
MP_SetPluginLoadBalanceType(3MPAPI)
MP_SetProbingPollingRate(3MPAPI)
MP_SetProprietaryProperties(3MPAPI)
nvlist_add_boolean_array(3NVPAIR)
nvlist_add_boolean_value(3NVPAIR)
nvlist_add_byte_array(3NVPAIR)
nvlist_add_int16_array(3NVPAIR)
nvlist_add_int32_array(3NVPAIR)
nvlist_add_int64_array(3NVPAIR)
nvlist_add_int8_array(3NVPAIR)
nvlist_add_nvlist_array(3NVPAIR)
nvlist_add_string_array(3NVPAIR)
nvlist_add_uint16_array(3NVPAIR)
nvlist_add_uint32_array(3NVPAIR)
nvlist_add_uint64_array(3NVPAIR)
nvlist_add_uint8_array(3NVPAIR)
nvlist_lookup_boolean(3NVPAIR)
nvlist_lookup_boolean_array(3NVPAIR)
nvlist_lookup_boolean_value(3NVPAIR)
nvlist_lookup_byte_array(3NVPAIR)
nvlist_lookup_int16_array(3NVPAIR)
nvlist_lookup_int32_array(3NVPAIR)
nvlist_lookup_int64_array(3NVPAIR)
nvlist_lookup_int8_array(3NVPAIR)
nvlist_lookup_nv_alloc(3NVPAIR)
nvlist_lookup_nvlist_array(3NVPAIR)
nvlist_lookup_string_array(3NVPAIR)
nvlist_lookup_uint16_array(3NVPAIR)
nvlist_lookup_uint32_array(3NVPAIR)
nvlist_lookup_uint64_array(3NVPAIR)
nvlist_lookup_uint8_array(3NVPAIR)
nvpair_value_boolean_array(3NVPAIR)
nvpair_value_boolean_value(3NVPAIR)
nvpair_value_byte_array(3NVPAIR)
nvpair_value_int16_array(3NVPAIR)
nvpair_value_int32_array(3NVPAIR)
nvpair_value_int64_array(3NVPAIR)
nvpair_value_int8_array(3NVPAIR)
nvpair_value_nvlist_array(3NVPAIR)
nvpair_value_string_array(3NVPAIR)
nvpair_value_uint16_array(3NVPAIR)
nvpair_value_uint32_array(3NVPAIR)
nvpair_value_uint64_array(3NVPAIR)
nvpair_value_uint8_array(3NVPAIR)
papiAttributeListAddBoolean(3PAPI)
papiAttributeListAddCollection(3PAPI)
papiAttributeListAddDatetime(3PAPI)
papiAttributeListAddInteger(3PAPI)
papiAttributeListAddMetadata(3PAPI)
papiAttributeListAddRange(3PAPI)
papiAttributeListAddResolution(3PAPI)
papiAttributeListAddString(3PAPI)
papiAttributeListAddValue(3PAPI)
papiAttributeListDelete(3PAPI)
papiAttributeListFromString(3PAPI)
papiAttributeListGetBoolean(3PAPI)
papiAttributeListGetCollection(3PAPI)
papiAttributeListGetDatetime(3PAPI)
papiAttributeListGetInteger(3PAPI)
papiAttributeListGetMetadata(3PAPI)
papiAttributeListGetNext(3PAPI)
papiAttributeListGetRange(3PAPI)
papiAttributeListGetResolution(3PAPI)
papiAttributeListGetString(3PAPI)
papiAttributeListGetValue(3PAPI)
papiAttributeListToString(3PAPI)
papiJobGetAttributeList(3PAPI)
papiJobSubmitByReference(3PAPI)
papiLibrarySupportedCall(3PAPI)
papiLibrarySupportedCalls(3PAPI)
papiPrinterGetAttributeList(3PAPI)
papiServiceGetAttributeList(3PAPI)
papiServiceGetEncryption(3PAPI)
papiServiceGetServiceName(3PAPI)
papiServiceGetStatusMessage(3PAPI)
papiServiceSetEncryption(3PAPI)
picld_plugin_register(3PICLTREE)
picl_get_frutree_parent(3PICL)
picl_get_propinfo_by_name(3PICL)
picl_get_propval_by_name(3PICL)
picl_set_propval_by_name(3PICL)
picl_walk_tree_by_class(3PICL)
pool_get_owning_resource(3POOL)
pool_get_resource_binding(3POOL)
pool_query_pool_resources(3POOL)
pool_query_resource_components(3POOL)
pool_resource_type_list(3POOL)
pool_resource_xtransfer(3POOL)
- process context library
cc [ flag... ] file... -lpctx [ library... ] #include <libpctx.h> typedef void (pctx_errfn_t)(const char *fn, const char *fmt, va_list ap);
pctx_t *pctx_create(const char *filename, char *const *argv, void *arg, int verbose, pctx_errfn_t *errfn);
pctx_t *pctx_capture(pid_t pid, void *arg, int verbose, pctx_errfn_t *errfn);
int pctx_run(pctx_t *pctx, uint_t sample, uint_t nsamples, int (*tick)(pctx *, pid_t, id_t, void *));
void pctx_release(pctx_t *pctx);
This family of functions allows a controlling process (the process that invokes them) to create or capture controlled processes. The functions allow the occurrence of various events of interest in the controlled process to cause the controlled process to be stopped, and to cause callback routines to be invoked in the controlling process.
There are two ways a process can be acquired by the process context functions. First, a named application can be invoked with the usual argv[] array using pctx_create(), which forks the caller and execs the application in the child. Alternatively, an existing process can be captured by its process ID using pctx_capture().
Both functions accept a pointer to an opaque handle, arg; this is saved and treated as a caller-private handle that is passed to the other functions in the library. Both functions accept a pointer to a printf(3C)-like error routine errfn; a default version is provided if NULL is specified.
A freshly-created process is created stopped; similarly, a process that has been successfully captured is stopped by the act of capturing it, thereby allowing the caller to specify the handlers that should be called when various events occur in the controlled process. The set of handlers is listed on the pctx_set_events(3CPC) manual page.
Once the callback handlers have been set with pctx_set_events(), the application can be set running using pctx_run(). This function starts the event handling loop; it returns only when either the process has exited, the number of time samples has expired, or an error has occurred (for example, if the controlling process is not privileged, and the controlled process has exec-ed a setuid program).
Every sample milliseconds the process is stopped and the tick( ) routine is called so that, for example, the performance counters can be sampled by the caller. No periodic sampling is performed if sample is 0.
Once pctx_run() has returned, the process can be released and the underlying storage freed using pctx_release(). Releasing the process will either allow the controlled process to continue (in the case of an existing captured process and its children) or kill the process (if it and its children were created using pctx_create()).
Upon successful completion, pctx_capture() and pctx_create() return a valid handle. Otherwise, the functions print a diagnostic message and return NULL.
Upon successful completion, pctx_run() returns 0 with the controlled process either stopped or exited (if the controlled process has invoked exit(2).) If an error has occurred (for example, if the controlled process has exec–ed a set-ID executable, if certain callbacks have returned error indications, or if the process was unable to respond to proc(4) requests) an error message is printed and the function returns -1.
Within an event handler in the controlling process, the controlled process can be made to perform various system calls on its behalf. No system calls are directly supported in this version of the API, though system calls are executed by the cpc_pctx family of interfaces in libcpc such as cpc_pctx_bind_event(3CPC). A specially created agent LWP is used to execute these system calls in the controlled process. See proc(4) for more details.
While executing the event handler functions, the library arranges for the signals SIGTERM, SIGQUIT, SIGABRT, and SIGINT to be blocked to reduce the likelihood of a keyboard signal killing the controlling process prematurely, thereby leaving the controlled process permanently stopped while the agent LWP is still alive inside the controlled process.
See attributes(5) for descriptions of the following attributes:
|
fork(2), cpc(3CPC), pctx_set_events(3CPC), libpctx(3LIB), proc(4), attributes(5)