sun.com docs.sun.com My Sun Worldwide Sites

Previous Previous     Contents     Index     Next Next

Functions for Querying Resource Pools and Associated Elements

The interfaces listed in this section are for performing queries related to pools and the associated elements.

pool_component_info(3POOL)

Return a string that describes the given component.

pool_conf_info(3POOL)

Return a string describing the entire configuration.

pool_conf_location(3POOL)

Return the location string that was provided to pool_conf_open() for the given specified configuration.

pool_conf_status(3POOL)

Return the validity status for a pool configuration.

pool_conf_validate(3POOL)

Check the validity of the contents of the given configuration.

pool_dynamic_location(3POOL)

Return the location that was used by the pools framework to store the dynamic configuration.

pool_error(3POOL)

Return the error value of the last failure that was recorded by calling a resource pool configuration library function.

pool_get_binding(3POOL)

Return the name of the pool on the running system that contains the set of resources to which the specified process is bound.

pool_get_owning_resource(3POOL)

Return the resource that currently contains the specified component.

pool_get_pool(3POOL)

Return the pool with the specified name from the provided configuration.

pool_get_property(3POOL)

Retrieve the value of the named property from the element.

pool_get_resource(3POOL)

Return the resource with the given name and type from the provided configuration.

pool_get_resource_binding(3POOL)

Return the name of the pool on the running system that contains the set of resources to which the given process is bound.

pool_get_status(3POOL)

Retrieve the current state of the pools facility.

pool_info(3POOL)

Return a description of the specified pool.

pool_query_components(3POOL)

Retrieve all resource components that match the specified list of properties.

pool_query_pool_resources(3POOL)

Return a null-terminated array of resources currently associated with the pool.

pool_query_pools(3POOL)

Return the list of pools that match the specified list of properties.

pool_query_resource_components(3POOL)

Return a null-terminated array of the components that make up the specified resource.

pool_query_resources(3POOL)

Return the list of resources that match the specified list of properties.

pool_resource_info(3POOL)

Return a description of the specified resource.

pool_resource_type_list(3POOL)

Enumerate the resource types that are supported by the pools framework on this platform.

pool_static_location(3POOL)

Return the location that was used by the pools framework to store the default configuration for pools framework instantiation.

pool_strerror(3POOL)

Return a description of each valid pool error code.

pool_value_get_bool(3POOL)

Get a property value of type boolean.

pool_value_get_double(3POOL)

Get a property value of type double.

pool_value_get_int64(3POOL)

Get a property value of type int64.

pool_value_get_name(3POOL)

Return the name that was assigned to the specified pool property.

pool_value_get_string(3POOL)

Get a property value of type string.

pool_value_get_type(3POOL)

Return the type of the data that is contained by the specified pool value.

pool_value_get_uint64(3POOL)

Get a property value of type uint64.

pool_version(3POOL)

Get the version number of the pool library.

pool_walk_components(3POOL)

Invoke callback on all components that are contained in the resource.

pool_walk_pools(3POOL)

Invoke callback on all pools that are defined in the configuration.

pool_walk_properties(3POOL)

Invoke callback on all properties defined for the given element.

pool_walk_resources(3POOL)

Invoke callback on all resources that are associated with the pool.

Resource Pool Code Examples

This section contains code examples of the resource pools interface.

Ascertain the Number of CPUs in the Resource Pool

sysconf(3C) provides information about the number of CPUs on an entire system. The following example provides the granularity of ascertaining the number of CPUs that are defined in a particular application's pools pset.

The key points for this example include the following:

  • pvals[] should be a NULL terminated array.

  • pool_query_pool_resources() returns a list of all resources that match the pvals array type pset from the application's pool my_pool. Because a pool can have only one instance of the pset resource, each instance is always returned in nelem. reslist[] contains only one element, the pset resource.

pool_value_t *pvals[2] = {NULL};  /* pvals[] should be NULL terminated */

/* NOTE: Return value checking/error processing omitted */
/* in all examples for brevity */

conf_loc = pool_dynamic_location();
conf = pool_conf_alloc();
pool_conf_open(conf, conf_loc, PO_RDONLY);
my_pool_name = pool_get_binding(getpid());
my_pool = pool_get_pool(conf, my_pool_name);
pvals[0] = pool_value_alloc();
pvals2[2] = { NULL, NULL };
pool_value_set_name(pvals[0], "type");
pool_value_set_string(pvals[0], "pset");

reslist = pool_query_pool_resources(conf, my_pool, &nelem, pvals);
pool_value_free(pvals[0]);
pool_query_resource_components(conf, reslist[0], &nelem, NULL);
printf("pool %s: %u cpu", my_pool_ name, nelem);
pool_conf_close(conf);

Previous Previous     Contents     Index     Next Next
Company Info Contact Terms of Use Privacy Copyright 1994-2007 Sun Microsystems, Inc.