DESCRIPTION

The pool_resource_create() function creates and returns a new resource of the given name and type in the provided configuration. If there is already a resource of the given name, the operation will fail.

The pool_resource_destroy() function removes the specified resource from its configuration file.

The pool_resource_info() function returns a string describing the given resource. The string is allocated with malloc(3C).
The caller is reponsible for freeing the returned string. If the flags argument is non-zero, the string returned also describes the components (if any) contained in the resource.

The pool_query_resource_components() function returns a null-terminated array of the components (if any) that comprise the given resource.

The pool_resource_transfer() function transfers size basic units from the source resource to the target. Both resources must be of the same type for the operation to succeed. Transfering units in this manner
translates to lowering the size property of the source resource by the specified size, while increasing the size property of the target by the same.

The pool_resource_xtransfer() function transfers the specific components from the source resource to the target. Both resources must be of the same type, and of a type that contains components (such as processor
sets). The components argument is a null-terminated list of pool_component_t.

The conf argument for each function refers to the target configuration to which the operation applies.

RETURN VALUES

Upon successful completion, pool_resource_create() returns a new pool_resource_t with default properties initialized. Otherwise, NULL is returned and pool_error(3POOL) returns the pool-specific error value.

Upon successful completion, pool_resource_info() returns a string describing the given resource (and optionally its components). Otherwise, NULL is returned and pool_error() returns the pool-specific error value.

Upon successful completion, pool_query_resource_components() returns a null-terminated array of pool_component_t * that match the provided null-terminated property list and are contained in the given resource. Otherwise, NULL
is returned and pool_error() returns the pool-specific error value.

Upon successful completion, pool_resource_transfer() and pool_resource_xtransfer() return 0. Otherwise -1 is returned and pool_error() returns the pool-specific error value.

ERRORS

The pool_resource_create() function will fail if:

POE_BADPARAM

The supplied configuration's status is not POF_VALID or name is in use for this resource type.

POE_INVALID_CONF

The resource element could not be created because the configuration would be invalid.

POE_PUTPROP

One of the supplied properties could not be set.

POE_SYSTEM

A system error has occurred. Check the system error code for more details.

The pool_resource_destroy() function will fail if:

POE_BADPARAM

The supplied configuration's status is not POF_VALID.

The pool_resource_info() function will fail if:

POE_BADPARAM

The supplied configuration's status is not POF_VALID or the flags paramter is neither 0 nor 1.

POE_INVALID_CONF

The configuration is invalid.

POE_SYSTEM

A system error has occurred. Check the system error code for more details.

The pool_query_resource_components() function will fail if:

POE_BADPARAM

The supplied configuration's status is not POF_VALID.

POE_INVALID_CONF

The configuration is invalid.

POE_SYSTEM

A system error has occurred. Check the system error code for more details.

The pool_resource_transfer() function will fail if:

POE_BADPARAM

The supplied configuration's status is not POF_VALID, the two resources are not of the same type, or the transfer would cause either of the resources to exceed their min and max properties.

POE_SYSTEM

A system error has occurred. Check the system error code for more details.

The pool_resource_xtransfer() function will fail if:

POE_BADPARAM

The supplied configuration's status is not POF_VALID, the two resources are not of the same type, or the supplied resources do not belong to the source.

POE_INVALID_CONF

The transfer operation failed and the configuration may be invalid.

POE_SYSTEM

A system error has occurred. Check the system error code for more details.