svcadm(1M)을 검색하려면 섹션에서 1M 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
pool_get_binding(3pool)
Pool Configuration Manipulation Library Functions pool_get_binding(3POOL)
NAME
pool_get_binding, pool_set_binding, pool_get_resource_binding - set and
query process to resource pool bindings
SYNOPSIS
cc [ flag... ] file... -lpool [ library... ]
#include <pool.h>
char *pool_get_binding(pid_t pid);
int pool_set_binding(const char *pool, idtype_t idtype,
id_t id);
char *pool_get_resource_binding(const char *type, pid_t pid);
DESCRIPTION
The pool_get_binding() function returns the name of the pool on the
running system to which the given process is bound.
The pool_set_binding() function binds a zone or processes matching
idtype and id to the pset associated with pool on the running system.
This function requires the privilege PRIV_SYS_RES_BIND or
PRIV_SYS_RES_CONFIG.
The idtype parameter can be one of the following types:
P_PID The id parameter is a pid.
P_TASKID The id parameter is a taskid. Bind the running processes of
a given task ID.
P_PROJID The id parameter is a project ID. Bind or query the running
processes of a given project ID.
P_CTID The id parameter is a contract ID. Bind the running pro‐
cesses of a given contract ID.
P_ZONEID The id parameter is a zone ID. Bind the running processes
of a given zone ID.
The pool_get_resource_binding() function returns the name of the
resource of the supplied type to which the supplied process is bound.
The only currently supported type is "pset".
The application must explicitly free the memory allocated for the
return values for pool_get_binding() and pool_get_resource_binding().
RETURN VALUES
Upon successful completion, pool_get_binding() returns the name of the
pool to which the process is bound. Otherwise it returns NULL and
pool_error(3POOL) returns the pool-specific error value.
Upon successful completion, pool_set_binding() returns PO_SUCCESS. Oth‐
erwise, it returns PO_FAIL and pool_error() returns the pool-specific
error value.
Upon successful completion, pool_get_resource_binding() returns the
name of the resource of the specified type to which the process is
bound. Otherwise it returns NULL and pool_error() returns the pool-spe‐
cific error value.
ERRORS
The pool_get_binding() function will fail if:
POE_INVALID_CONF The configuration is invalid.
POE_SYSTEM A system error has occurred. Check the system error
code for more details.
The pool_set_binding() function will fail if:
POE_INVALID_SEARCH The pool could not be found.
POE_INVALID_CONF The configuration is invalid.
POE_SYSTEM A system error has occurred. Check the system
error code for more details.
The pool_get_resource_binding() function will fail if:
POE_INVALID_CONF The configuration is invalid.
POE_SYSTEM A system error has occurred. Check the system error
code for more details.
EXAMPLES
Example 1 Bind the current process to the pool named "target".
#include <sys/types.h>
#include <pool.h>
#include <unistd.h>
...
id_t pid = getpid();
...
if (pool_set_binding("target", P_PID, pid) == PO_FAIL) {
(void) fprintf(stderr, "pool binding failed (%d)\n",
pool_error());
}
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 10 Feb 2020 pool_get_binding(3POOL)