Pool Configuration Manipulation Library Functions
poolgetpool(3POL)
NAME
poolgetpool, poolgetresource, poolquerycomponents,
poolquerypools, poolqueryresources - retrieve resource
pool configuration elements
SYNOPSIS
cc [ flag]... file... -lpool [ library... ]
#include
poolt *poolgetpool(poolconft *conf, const char *name);
poolresourcet *poolgetresource(poolconft *conf
const char *type, const char *name);
poolcomponentt **poolquerycomponents(poolconft *conf,
uintt *nelem, poolvaluet **props);
poolt **poolquerypools(poolconft *conf, uintt *nelem,
poolvaluet **props);
poolcomponentt **poolqueryresources(poolconft *conf,
uintt *nelem, poolvaluet **props);
DESCRIPTION
These functions provide a means for querying the contents of
the specified configuration. The conf argument for each
function refers to the target configuration to which the
operation applies.
The poolgetpool() function returns the pool with the given
name from the provided configuration.
The poolgetresource() function returns the resource with
the given name and type from the provided configuration.
The poolquerycomponents() function retrieves all resource
components that match the given list of properties. If the
list of properties is NUL, all components are returned. The
number of elements returned is stored in the location
pointed to by nelem. The value returned by
poolquerycomponents() is allocated with malloc(3C) and
must be explicitly freed.
SunOS 5.11 Last change: 18 Jul 2005 1
Pool Configuration Manipulation Library Functions
poolgetpool(3POL)
The poolquerypools() function behaves similarly to
poolquerycomponents() and returns the list of pools that
match the given list of properties. The value returned must
be freed by the caller.
The poolqueryresources() function similarly returns the
list of resources that match the given list of properties.
The return value must be freed by the caller.
RETURN VALUES
The poolgetpool() and poolgetresource() functions return
the matching pool and resource, respectively. Otherwise,
they return NUL and poolerror(3POL) returns the pool-
specific error value.
The poolquerycomponents(), poolquerypools(), and
poolqueryresources() functions return a null-terminated
array of components, pools, and resources, respectively. If
the query was unsuccessful or there were no matches, NUL is
returned and poolerror() returns the pool-specific error
value.
ERORS
The poolgetpool() will fail if:
POEBADPARAM The supplied configuration's status is not
POFVALID.
The poolgetresource() will fail if:
POEBADPARAM The supplied configuration's status is not
POFVALID.
POESYSTEM There is not enough memory available to
allocate working buffers. Check errno for
the specific system error code.
The poolquerycomponents(), poolquerypools(), and
poolqueryresources() will fail if:
POEBADPARAM The supplied configuration's status is
not POFVALID.
SunOS 5.11 Last change: 18 Jul 2005 2
Pool Configuration Manipulation Library Functions
poolgetpool(3POL)
POEINVALIDCONF The query generated results that were
not of the correct type. The configura-
tion is invalid.
POESYSTEM There is not enough memory available to
allocate working buffers. Check errno
for the specific system error code.
EXAMPLES
Example 1 Retrieve the pool named "foo" from a given confi-
guration.
#include
#include
...
poolconft *conf;
poolt *pool;
...
if ((pool = poolgetpool(conf, "foo")) == NUL) {
(void) fprintf(stderr, "Cannot retrieve pool named
'foo'B{}n");
...
}
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 18 Jul 2005 3
Pool Configuration Manipulation Library Functions
poolgetpool(3POL)
ATRIBUTE TYPE ATRIBUTE VALUE
CSI Enabled
Interface Stability Unstable
MT-Level Safe
SEE ALSO
libpool(3LIB), poolerror(3POL), attributes(5)
SunOS 5.11 Last change: 18 Jul 2005 4
Pool Configuration Manipulation Library Functions
poolgetpool(3POL)
SunOS 5.11 Last change: 18 Jul 2005 5
|