1 POOL_ASSOCIATE(3POOL)        Pool Configuration Manipulation Library Functions
   2 
   3 
   4 
   5 NAME
   6        pool_associate, pool_create, pool_destroy, pool_dissociate, pool_info,
   7        pool_query_pool_resources - resource pool manipulation functions
   8 
   9 SYNOPSIS
  10        cc [ flag... ] file... -lpool [ library... ]
  11        #include <pool.h>
  12 
  13        int pool_associate(pool_conf_t *conf,  pool_t *pool,
  14             pool_resource_t *resource);
  15 
  16 
  17        pool_t *pool_create(pool_conf_t *conf, const char *name);
  18 
  19 
  20        int pool_destroy(pool_conf_t *conf, pool_t *pool);
  21 
  22 
  23        int pool_dissociate(pool_conf_t *conf, pool_t *pool,
  24             pool_resource_t *resource);
  25 
  26 
  27        const char *pool_info(pool_conf_t *conf, pool_t *pool,
  28             int flags);
  29 
  30 
  31        pool_resource_t **pool_query_pool_resources(pool_conf_t *conf,
  32             pool_t *pool, uint_t *nelem, pool_value_t **properties);
  33 
  34 
  35 DESCRIPTION
  36        These functions provide mechanisms for constructing and modifying pools
  37        entries within a target pools configuration.  The conf argument for
  38        each function refers to the target configuration to which the operation
  39        applies.
  40 
  41 
  42        The pool_associate() function associates the specified resource with
  43        pool. A resource can be associated with multiple pools at the same
  44        time.  Any resource of this type that was formerly associated with this
  45        pool is no longer associated with the pool. The new association
  46        replaces the earlier one.
  47 
  48 
  49        The pool_create() function creates a new pool with the supplied name
  50        with its default properties initialized, and associated with the
  51        default resource of each type.
  52 
  53 
  54        The pool_destroy function() destroys the given pool association.
  55        Associated resources are not modified.
  56 
  57 
  58        The pool_dissociate() function removes the association between the
  59        given resource and pool. On successful completion, the pool is
  60        associated with the default resource of the same type.
  61 
  62 
  63        The pool_info() function returns a string describing the given pool.
  64        The string is allocated with malloc(3C). The caller is responsible for
  65        freeing the returned string. If the flags option is non-zero, the
  66        string returned also describes the associated resources of the pool.
  67 
  68 
  69        The pool_query_pool_resources() function returns a null-terminated
  70        array of resources currently associated with the pool that match the
  71        given list of properties. The return value must be freed by the caller.
  72        The nelem argument is set to be the length of the array returned.
  73 
  74 RETURN VALUES
  75        Upon successful completion, pool_create() returns a new initialized
  76        pool.  Otherwise it returns NULL and pool_error(3POOL) returns the
  77        pool-specific error value.
  78 
  79 
  80        Upon successful completion, pool_associate(), pool_destroy(), and
  81        pool_dissociate() return 0. Otherwise, they return -1 and pool_error()
  82        returns the pool-specific error value.
  83 
  84 
  85        Upon successful completion, pool_info() returns a string describing the
  86        given pool. Otherwise it returns NULL and pool_error() returns the
  87        pool-specific error value.
  88 
  89 
  90        Upon successful completion, pool_query_pool_resources() returns a null-
  91        terminated array of resources. Otherwise it returns NULL and
  92        pool_error() returns the pool-specific error value.
  93 
  94 ERRORS
  95        The pool_create() function will fail if:
  96 
  97        POE_BADPARAM
  98                            The supplied configuration's status is not
  99                            POF_VALID or name is already in use.
 100 
 101 
 102        POE_SYSTEM
 103                            A system error has occurred. Check the system error
 104                            code for more details.
 105 
 106 
 107        POE_INVALID_CONF
 108                            The pool element could not be created because the
 109                            configuration would be invalid.
 110 
 111 
 112        POE_PUTPROP
 113                            One of the supplied properties could not be set.
 114 
 115 
 116 
 117        The pool_destroy() function will fail if:
 118 
 119        POE_BADPARAM
 120                        The supplied configuration's status is not POF_VALID.
 121 
 122 
 123 
 124        The pool_associate() function will fail if:
 125 
 126        POE_BADPARAM
 127                        The supplied configuration's status is not POF_VALID or
 128                        the parameters are supplied from a different
 129                        configuration.
 130 
 131 
 132        POE_SYSTEM
 133                        A system error has occurred. Check the system error
 134                        code for more details.
 135 
 136 
 137 
 138        The pool_disassociate() function will fail if:
 139 
 140        POE_BADPARAM
 141                            The supplied configuration's status is not
 142                            POF_VALID or the parameters are supplied from a
 143                            different configuration.
 144 
 145 
 146        POE_INVALID_CONF
 147                            No resources could be located for the supplied
 148                            configuration or the supplied configuration is not
 149                            valid (for example, more than one default for a
 150                            resource type was found.)
 151 
 152 
 153        POE_SYSTEM
 154                            A system error has occurred. Check the system error
 155                            code for more details.
 156 
 157 
 158 
 159        The pool_info() function will fail if:
 160 
 161        POE_BADPARAM
 162                            The supplied configuration's status is not
 163                            POF_VALID or the flags parameter is neither 0 or 1.
 164 
 165 
 166        POE_INVALID_CONF
 167                            The configuration is invalid.
 168 
 169 
 170        POE_SYSTEM
 171                            A system error has occurred. Check the system error
 172                            code for more details.
 173 
 174 
 175 
 176        The pool_query_pool_resources() function will fail if:
 177 
 178        POE_BADPARAM
 179                            The supplied configuration's status is not
 180                            POF_VALID.
 181 
 182 
 183        POE_INVALID_CONF
 184                            The configuration is invalid.
 185 
 186 
 187        POE_SYSTEM
 188                            A system error has occurred. Check the system error
 189                            code for more details.
 190 
 191 
 192 USAGE
 193        Pool names are unique across pools in a given configuration file. It is
 194        an error to attempt to create a pool with a name that is currently used
 195        by another pool within the same configuration.
 196 
 197 ATTRIBUTES
 198        See attributes(5) for descriptions of the following attributes:
 199 
 200 
 201 
 202 
 203        +--------------------+-----------------+
 204        |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
 205        +--------------------+-----------------+
 206        |CSI                 | Enabled         |
 207        +--------------------+-----------------+
 208        |Interface Stability | Unstable        |
 209        +--------------------+-----------------+
 210        |MT-Level            | Safe            |
 211        +--------------------+-----------------+
 212 
 213 SEE ALSO
 214        libpool(3LIB), pool_error(3POOL), attributes(5)
 215 
 216 
 217 
 218                                January 15, 2020          POOL_ASSOCIATE(3POOL)