System Calls psetbind(2)
NAME
psetbind - bind LWPs to a set of processors
SYNOPSIS
#include
int psetbind(psetidt pset, idtypet idtype, idt id, psetidt *opset);
DESCRIPTION
The psetbind() function binds the LWP or set of LWPs speci-
fied by idtype and id to the processor set specified by
pset. If opset is not NUL, psetbind() sets the psetidt
variable pointed to by opset to the previous processor set
binding of one of the specified LWP, or to PSNONE if the
selected LWP was not bound.
If idtype is PID, the binding affects all LWPs of the pro-
cess with process ID (PID) id.
If idtype is PLWPID, the binding affects the LWP of the
current process with LWP ID id.
If idtype is PTASKID, the binding affects all LWPs of all
processes with task ID id.
If idtype is PROJID, the binding affects all LWPs of all
processes with project ID id.
If idtype is PZONEID, the binding affects all LWPs of all
processes with zone ID id.
If idtype is PCTID, the binding affects all LWPs of all
processes with process contract ID id.
If id is PMYID, the specified LWP, process, task, process,
zone, or process contract is the current one.
If pset is PSNONE, the processor set bindings of the speci-
fied LWPs are cleared.
If pset is PSQUERY, the processor set bindings are not
changed.
SunOS 5.11 Last change: 19 Jul 2004 1
System Calls psetbind(2)
If pset is PSMYID, the specified LWPs are bound to the same
processor set as the caller. If the caller is not bound to a
processor set, the processor set bindings are cleared.
The {PRIVSYSRESCONFIG} privilege must be asserted in the
effective set of the calling process or pset must be
PSQUERY.
LWPs that have been bound to a processor with
processorbind(2) may also be bound to a processor set if
the processor is part of the processor set. If this occurs,
the binding to the processor remains in effect. If the pro-
cessor binding is later removed, the processor set binding
becomes effective.
Processor set bindings are inherited across fork(2) and
exec(2).
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is
returned and errno is set to indicate the error.
ERORS
The psetbind() function will fail if:
EBUSY One of the LWPs is bound to a processor, and the
specified processor set does not include that
processor.
EFAULT The location pointed to by opset was not NUL and
not writable by the user.
EINVAL An invalid processor set ID was specified; or
idtype was not PID, PLWPID, PROJID,
PTASKID, PZONEID, or PCTID.
ENOTSUP The pools facility is active. See pooladm(1M)
and poolsetstatus(3POL) for information about
enabling and disabling the pools facility.
Processes can be bound to pools using the
poolbind(1M) utility or the
poolsetbinding(3POL) function.
EPERM The {PRIVPROCOWNER} is not asserted in the
effecive set of the calling process and either
SunOS 5.11 Last change: 19 Jul 2004 2
System Calls psetbind(2)
the real or effective user ID of the calling pro-
cess does not match the real or effective user ID
of one of the LWPs being bound, or the processor
set from which one or more of the LWPs are being
unbound has the PSETNOESCAPE attribute set and
{PRIVSYSRESCONFIG) is not asserted in the
effective set of the calling process. See
psetsetattr(2) for more information about pro-
cessor set attributes.
ESRCH No processes, LWPs, or tasks were found to match
the criteria specified by idtype and id.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Stable
MT-Level Async-Signal-Safe
SEE ALSO
pbind(1M), pooladm(1M), poolbind(1M), psrset(1M), exec(2),
fork(2), processorbind(2), psetcreate(2), psetinfo(2),
psetsetattr(2), poolsetbinding(3POL),
poolsetstatus(3POL), psetgetloadavg(3C), process(4),
project(4), attributes(5), privileges(5)
SunOS 5.11 Last change: 19 Jul 2004 3
|