| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 2: System Calls Oracle Solaris 11 Information Library |
- bind LWPs to a processor
#include <sys/types.h>#include <sys/processor.h>#include <sys/procset.h>intprocessor_bind(idtype_tidtype,id_tid,processorid_tprocessorid,processorid_t *obind);
Theprocessor_bind() function binds the LWP (lightweight process) or set of LWPsspecified byidtype andid to the processor specified byprocessorid.Ifobind is notNULL, this function also sets theprocessorid_t variablepointed to byobind to the previous binding of one of thespecified LWPs, or toPBIND_NONE if the selected LWP was not bound.
Ifidtype isP_PID, the binding affects all LWPs of the processwith process ID (PID)id.
Ifidtype isP_LWPID, the binding affects the LWP of the currentprocess with LWP IDid.
Ifidtype isP_TASKID, the binding affects all LWPs of all processeswith task IDid.
Ifidtype isP_PROJID, the binding affects all LWPs of all processeswith project IDid.
Ifidtype isP_CTID, the binding affects all LWPs of all processeswith process contract IDid.
Ifidtype isP_ZONEID, the binding affects all LWPs of all processeswith zone IDid.
Ifid isP_MYID, the specified LWP, process, task, or project isthe current one.
Ifprocessorid isPBIND_NONE, the processor bindings of the specified LWPs arecleared.
Ifprocessorid isPBIND_QUERY, the processor bindings are not changed.
The {PRIV_PROC_OWNER} privilege must be asserted in the effective set of thecalling process or the real or effective user ID of the callingprocess must match the real or effective user ID of the LWPsbeing bound. If the calling process does not have permission to changeall of the specified LWPs, the bindings of the LWPs for whichit does have permission will be changed even though an error isreturned.
Processor bindings are inherited acrossfork(2) andexec(2).
Upon successful completion,0 is returned. Otherwise,-1 is returned anderrno is set to indicate the error.
Theprocessor_bind() function will fail if:
The location pointed to byobind was notNULL and not writable by the user.
The specified processor is not on-line, or theidtype argument was notP_PID,P_LWPID,P_PROJID,P_TASKID,P_CTID, orP_ZONEID.
The caller is in a non-global zone, the pools facility is active, and the processor is not a member of the zone's pool's processor set.
Binding a system process to a processor set is not supported.
The {PRIV_PROC_OWNER} privilege is not asserted in the effective set of the calling process and its real or effective user ID does not match the real or effective user ID of one of the LWPs being bound.
No processes, LWPs, or tasks were found to match the criteria specified byidtype andid.
Seeattributes(5) for descriptions of the following attributes:
|
pooladm(1M),psradm(1M),psrinfo(1M),zoneadm(1M),exec(2),fork(2),p_online(2),pset_bind(2),sysconf(3C),process(4),project(4),attributes(5),privileges(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |