The processor_bind() function
binds the LWP (lightweight process) or set of LWPs specified by idtype and id to the processor specified by processorid. If obind is not NULL, this
function also sets the processorid_t variable pointed to by obind to the previous binding of one of the specified LWPs, or to PBIND_NONE if the selected LWP was not bound.
If idtype is P_PID, the binding affects all LWPs of the process with process ID (PID) id.
If idtype is P_LWPID, the binding affects the LWP of the current process with LWP ID id.
If idtype is P_TASKID, the binding affects all LWPs of all processes with task ID id.
If idtype is P_PROJID, the binding affects all LWPs of all processes with project ID id.
If id is P_MYID, the specified LWP, process, task, or process is the current one.
If processorid is PBIND_NONE, the processor bindings of the specified LWPs are cleared.
If processorid is PBIND_QUERY, the processor bindings are not changed.
The effective user of the calling process must be superuser, or its real or effective user ID must match the real or effective user ID of the LWPs being bound. If the calling process does not have permission to change all of the specified LWPs, the bindings of the LWPs for which it does have permission will be changed even though an error is returned.
Processor bindings are inherited across fork(2) and exec(2).
|