pool_get_resource(3pool) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

pool_get_resource(3pool)

po...ol(3POOL) Pool Configuration Manipulation Library Functionspo...ol(3POOL)

NAME
       pool_get_pool,         pool_get_resource,        pool_query_components,
       pool_query_pools, pool_query_resources - retrieve resource pool config‐
       uration elements

SYNOPSIS
       cc [ flag]...  file... -lpool [ library... ]
       #include <pool.h>

       pool_t *pool_get_pool(pool_conf_t *conf, const char *name);


       pool_resource_t *pool_get_resource(pool_conf_t *conf,
            const char *type, const char *name);


       pool_component_t **pool_query_components(pool_conf_t *conf,
            uint_t *nelem, pool_value_t **props);


       pool_t **pool_query_pools(pool_conf_t *conf, uint_t *nelem,
            pool_value_t **props);


       pool_resource_t **pool_query_resources(pool_conf_t *conf,
            uint_t *nelem, pool_value_t **props);

DESCRIPTION
       These functions provide a means for querying the contents of the speci‐
       fied configuration. The conf argument for each function refers  to  the
       target configuration to which the operation applies.


       The  pool_get_pool() function returns the pool with the given name from
       the provided configuration.


       The pool_get_resource() function returns the resource  with  the  given
       name  and  type from the provided configuration. The only resource type
       is pset.


       The pool_query_components()  function  retrieves  all  components  that
       match  the  given list of properties. Components represent CPUS. If the
       list of properties is NULL, all components are returned. The number  of
       elements  returned  is  stored in the location pointed to by nelem. The
       value returned by pool_query_components() is allocated with  malloc(3C)
       and must be explicitly freed.


       The  pool_query_pools() function behaves similarly to pool_query_compo‐
       nents() and returns the list of pools that  match  the  given  list  of
       properties. The value returned must be freed by the caller.


       The  pool_query_resources()  function similarly returns the list of re‐
       sources that match the given list of properties. The return value  must
       be freed by the caller.

RETURN VALUES
       The pool_get_pool() and pool_get_resource() functions return the match‐
       ing  pool  and  resource, respectively. Otherwise, they return NULL and
       pool_error(3POOL) returns the pool-specific error value.


       The  pool_query_components(),  pool_query_pools(),  and  pool_query_re‐
       sources()  functions  return  a  null-terminated  array  of components,
       pools, and resources, respectively. If the query  was  unsuccessful  or
       there  were  no  matches, NULL is returned and pool_error() returns the
       pool-specific error value.

ERRORS
       The pool_get_pool() will fail if:

       POE_BADPARAM    The supplied configuration's status is not POF_VALID.



       The pool_get_resource() will fail if:

       POE_BADPARAM    The supplied configuration's status is not POF_VALID.


       POE_SYSTEM      There is not enough memory available to allocate  work‐
                       ing  buffers. Check errno for the specific system error
                       code.



       The  pool_query_components(),  pool_query_pools(),  and  pool_query_re‐
       sources() will fail if:

       POE_BADPARAM        The   supplied   configuration's   status   is  not
                           POF_VALID.


       POE_INVALID_CONF    The query generated results that were  not  of  the
                           correct type. The configuration is invalid.


       POE_SYSTEM          There  is  not  enough memory available to allocate
                           working buffers. Check errno for the specific  sys‐
                           tem error code.


EXAMPLES
       Example 1 Retrieve the pool named "foo" from a given configuration.


         #include <pool.h>
         #include <stdio.h>

         ...

         pool_conf_t *conf;
         pool_t *pool;

         ...

         if ((pool = pool_get_pool(conf, "foo")) == NULL) {
                 (void) fprintf(stderr, "Cannot retrieve pool named
                 'foo'\n");
                 ...
         }




ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ CSIEnabled _ Interface StabilityUncommitted _ MT-Level‐
       Safe


SEE ALSO
       libpool(3LIB), pool_error(3POOL), attributes(7)

Oracle Solaris 11.4               2 Feb 2015                    po...ol(3POOL)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3