Print this page
12202 noise in example code in some section 3pool man pages


  27        returns more than one pool (since the set of resources is referred to
  28        by more than one pool), NULL is  returned and the pool error value is
  29        set to POE_INVALID_SEARCH.
  30 
  31 
  32        It is possible that one of the resources to which the given process is
  33        bound is not associated with a pool. This could occur if a processor
  34        set was created with one of the pset_() functions and the process was
  35        then bound to that set. It could also occur if the process was bound to
  36        a resource set not currently associated with a pool, since resources
  37        can exist that are not associated with a pool.
  38 
  39 
  40        The pool_set_binding() function binds the processes matching idtype and
  41        id to the resources associated with pool on the running system.  This
  42        function requires the privilege required by the underlying resource
  43        types referenced by the pool; generally, this requirement is equivalent
  44        to requiring superuser privilege.
  45 
  46 
  47        The idtype parameter can be of the following types:
  48 
  49        P_PID
  50                    The id parameter is a pid.
  51 
  52 
  53        P_TASKID
  54                    The id parameter is a taskid.
  55 
  56 
  57        P_PROJID
  58                    The id parameter is a project ID. All currently running
  59                    processes belonging to the given project will be bound to
  60                    the pool's resources.
  61 
  62 
  63 
  64        The pool_get_resource_binding() function returns the name of the
  65        resource of the supplied type to which the supplied process is bound.
  66 
  67 
  68        The application must explicity free the memory allocated for the return
  69        values for pool_get_binding() and pool_get_resource_binding().
  70 
  71 RETURN VALUES
  72        Upon successful completion, pool_get_binding() returns the name of the
  73        pool to which the process is bound. Otherwise it returns NULL and
  74        pool_error(3POOL) returns the pool-specific error value.
  75 
  76 
  77        Upon successful completion, pool_set_binding() returns PO_SUCCESS.
  78        Otherwise, it returns PO_FAIL and pool_error() returns the pool-
  79        specific error value.
  80 
  81 
  82        Upon successful completion, pool_get_resource_binding() returns the
  83        name of the resource of the specified type to which the process is
  84        bound. Otherwise it returns NULL and pool_error() returns the pool-
  85        specific error value.
  86 
  87 ERRORS
  88        The pool_get_binding() function will fail if:
  89 


 133 
 134        POE_SYSTEM
 135                              A system error has occurred. Check the system
 136                              error code for more details.
 137 
 138 
 139 EXAMPLES
 140        Example 1 Bind the current process to the pool named "target".
 141 
 142          #include <sys/types.h>
 143          #include <pool.h>
 144          #include <unistd.h>
 145 
 146          ...
 147 
 148          id_t pid = getpid();
 149 
 150          ...
 151 
 152          if (pool_set_binding("target", P_PID, pid) == PO_FAIL)
 153                  (void) fprintf(stderr, "pool binding failed (\%d)\B{}n",
 154                           pool_error());
 155 
 156 
 157 
 158 ATTRIBUTES
 159        See attributes(5) for descriptions of the following attributes:
 160 
 161 
 162 
 163 
 164        +--------------------+-----------------+
 165        |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
 166        +--------------------+-----------------+
 167        |CSI                 | Enabled         |
 168        +--------------------+-----------------+
 169        |Interface Stability | Unstable        |
 170        +--------------------+-----------------+
 171        |MT-Level            | Safe            |
 172        +--------------------+-----------------+
 173 
 174 SEE ALSO
 175        libpool(3LIB), pool_error(3POOL), attributes(5)
 176 
 177 
 178 
 179                                 March 27, 2007         POOL_GET_BINDING(3POOL)


  27        returns more than one pool (since the set of resources is referred to
  28        by more than one pool), NULL is  returned and the pool error value is
  29        set to POE_INVALID_SEARCH.
  30 
  31 
  32        It is possible that one of the resources to which the given process is
  33        bound is not associated with a pool. This could occur if a processor
  34        set was created with one of the pset_() functions and the process was
  35        then bound to that set. It could also occur if the process was bound to
  36        a resource set not currently associated with a pool, since resources
  37        can exist that are not associated with a pool.
  38 
  39 
  40        The pool_set_binding() function binds the processes matching idtype and
  41        id to the resources associated with pool on the running system.  This
  42        function requires the privilege required by the underlying resource
  43        types referenced by the pool; generally, this requirement is equivalent
  44        to requiring superuser privilege.
  45 
  46 
  47        The idtype parameter can be one of the following types:
  48 
  49        P_PID
  50                    The id parameter is a pid.
  51 
  52 
  53        P_TASKID
  54                    The id parameter is a taskid.
  55 
  56 
  57        P_PROJID
  58                    The id parameter is a project ID. All currently running
  59                    processes belonging to the given project will be bound to
  60                    the pool's resources.
  61 
  62 
  63 
  64        The pool_get_resource_binding() function returns the name of the
  65        resource of the supplied type to which the supplied process is bound.
  66 
  67 
  68        The application must explicitly free the memory allocated for the
  69        return values for pool_get_binding() and pool_get_resource_binding().
  70 
  71 RETURN VALUES
  72        Upon successful completion, pool_get_binding() returns the name of the
  73        pool to which the process is bound. Otherwise it returns NULL and
  74        pool_error(3POOL) returns the pool-specific error value.
  75 
  76 
  77        Upon successful completion, pool_set_binding() returns PO_SUCCESS.
  78        Otherwise, it returns PO_FAIL and pool_error() returns the pool-
  79        specific error value.
  80 
  81 
  82        Upon successful completion, pool_get_resource_binding() returns the
  83        name of the resource of the specified type to which the process is
  84        bound. Otherwise it returns NULL and pool_error() returns the pool-
  85        specific error value.
  86 
  87 ERRORS
  88        The pool_get_binding() function will fail if:
  89 


 133 
 134        POE_SYSTEM
 135                              A system error has occurred. Check the system
 136                              error code for more details.
 137 
 138 
 139 EXAMPLES
 140        Example 1 Bind the current process to the pool named "target".
 141 
 142          #include <sys/types.h>
 143          #include <pool.h>
 144          #include <unistd.h>
 145 
 146          ...
 147 
 148          id_t pid = getpid();
 149 
 150          ...
 151 
 152          if (pool_set_binding("target", P_PID, pid) == PO_FAIL)
 153                  (void) fprintf(stderr, "pool binding failed (%d)\n",
 154                           pool_error());
 155 
 156 
 157 
 158 ATTRIBUTES
 159        See attributes(5) for descriptions of the following attributes:
 160 
 161 
 162 
 163 
 164        +--------------------+-----------------+
 165        |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
 166        +--------------------+-----------------+
 167        |CSI                 | Enabled         |
 168        +--------------------+-----------------+
 169        |Interface Stability | Unstable        |
 170        +--------------------+-----------------+
 171        |MT-Level            | Safe            |
 172        +--------------------+-----------------+
 173 
 174 SEE ALSO
 175        libpool(3LIB), pool_error(3POOL), attributes(5)
 176 
 177 
 178 
 179                                January 18, 2020        POOL_GET_BINDING(3POOL)