Pool Configuration Manipulation Library Functions
poolgetbinding(3POL)
NAME
poolgetbinding, poolsetbinding,
poolgetresourcebinding - set and query process to
resource pool bindings
SYNOPSIS
cc [ flag... ] file... -lpool [ library... ]
#include
char *poolgetbinding(pidt pid);
int poolsetbinding(const char *pool, idtypet idtype,
idt id);
char *poolgetresourcebinding(const char *type, pidt pid);
DESCRIPTION
The poolgetbinding() function returns the name of the pool
on the running system that contains the set of resources to
which the given process is bound. If no such pool exists on
the system or the search returns more than one pool (since
the set of resources is referred to by more than one pool),
NUL is returned and the pool error value is set to
POEINVALIDSEARCH.
It is possible that one of the resources to which the given
process is bound is not associated with a pool. This could
occur if a processor set was created with one of the pset()
functions and the process was then bound to that set. It
could also occur if the process was bound to a resource set
not currently associated with a pool, since resources can
exist that are not associated with a pool.
The poolsetbinding() function binds the processes matching
idtype and id to the resources associated with pool on the
running system. This function requires the privilege
required by the underlying resource types referenced by the
pool; generally, this requirement is equivalent to requiring
superuser privilege.
The idtype parameter can be of the following types:
PID The id parameter is a pid.
SunOS 5.11 Last change: 27 Mar 2007 1
Pool Configuration Manipulation Library Functions
poolgetbinding(3POL)
PTASKID The id parameter is a taskid.
PROJID The id parameter is a project ID. All currently
running processes belonging to the given project
will be bound to the pool's resources.
The poolgetresourcebinding() function returns the name of
the resource of the supplied type to which the supplied pro-
cess is bound.
The application must explicity free the memory allocated for
the return values for poolgetbinding() and
poolgetresourcebinding().
RETURN VALUES
Upon successful completion, poolgetbinding() returns the
name of the pool to which the process is bound. Otherwise it
returns NUL and poolerror(3POL) returns the pool-specific
error value.
Upon successful completion, poolsetbinding() returns
POSUCES. Otherwise, it returns POFAIL and poolerror()
returns the pool-specific error value.
Upon successful completion, poolgetresourcebinding()
returns the name of the resource of the specified type to
which the process is bound. Otherwise it returns NUL and
poolerror() returns the pool-specific error value.
ERORS
The poolgetbinding() function will fail if:
POEINVALIDCONF The configuration is invalid.
POEINVALIDSEARCH It is not possible to determine the
binding for this target due to the
overlapping nature of the pools con-
figured for this system, or the pool
could not be located.
POESYSTEM A system error has occurred. Check the
system error code for more details.
SunOS 5.11 Last change: 27 Mar 2007 2
Pool Configuration Manipulation Library Functions
poolgetbinding(3POL)
The poolsetbinding() function will fail if:
POEINVALIDSEARCH The pool could not be found.
POEINVALIDCONF The configuration is invalid.
POESYSTEM A system error has occurred. Check the
system error code for more details.
The poolgetresourcebinding() function will fail if:
POEINVALIDCONF The configuration is invalid.
POEINVALIDSEARCH The target is not bound to a resource
of the specified type.
POESYSTEM A system error has occurred. Check the
system error code for more details.
EXAMPLES
Example 1 Bind the current process to the pool named "tar-
get".
#include
#include
#include
...
idt pid = getpid();
...
if (poolsetbinding("target", PID, pid) == POFAIL)
(void) fprintf(stderr, "pool binding failed (d)B{}n",
poolerror());
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 27 Mar 2007 3
Pool Configuration Manipulation Library Functions
poolgetbinding(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: 27 Mar 2007 4
Pool Configuration Manipulation Library Functions
poolgetbinding(3POL)
SunOS 5.11 Last change: 27 Mar 2007 5
|