2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
4 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
5 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PROCESSOR_BIND 2 "Dec 27, 2015"
8 processor_bind \- bind LWPs to a processor
12 #include <sys/types.h>
13 #include <sys/processor.h>
14 #include <sys/procset.h>
16 \fBint\fR \fBprocessor_bind\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBprocessorid_t\fR \fIprocessorid\fR,
17 \fBprocessorid_t *\fR\fIobind\fR);
22 The \fBprocessor_bind()\fR function binds the LWP (lightweight process) or set
23 of LWPs specified by \fIidtype\fR and \fIid\fR to the processor specified by
24 \fIprocessorid\fR. If \fIobind\fR is not \fINULL\fR, this function also sets
25 the \fBprocessorid_t\fR variable pointed to by \fIobind\fR to the previous
26 binding of one of the specified LWPs, or to \fBPBIND_NONE\fR if the selected
30 If \fIidtype\fR is \fBP_PID\fR, the binding affects all LWPs of the process
31 with process ID (PID) \fIid\fR.
34 If \fIidtype\fR is \fBP_LWPID\fR, the binding affects the LWP of the current
35 process with LWP ID \fIid\fR.
38 If \fIidtype\fR is \fBP_TASKID\fR, the binding affects all LWPs of all
39 processes with task ID \fIid\fR.
42 If \fIidtype\fR is \fBP_PROJID\fR, the binding affects all LWPs of all
43 processes with project ID \fIid\fR.
46 If \fIidtype\fR is \fBP_CTID\fR, the binding affects all LWPs of all processes
47 with process contract ID \fIid\fR.
50 If \fIidtype\fR is \fBP_ZONEID\fR, the binding affects all LWPs of all
51 processes with zone ID \fIid\fR.
54 If \fIid\fR is \fBP_MYID\fR, the specified LWP, process, task, or project is
58 If \fIprocessorid\fR is \fBPBIND_NONE\fR, the processor bindings of the
59 specified LWPs are cleared.
62 If \fIprocessorid\fR is \fBPBIND_QUERY\fR, the processor bindings are not
66 The {\fBPRIV_PROC_OWNER\fR} privilege must be asserted in the effective set of
67 the calling process or the real or effective user ID of the calling process
68 must match the real or effective user ID of the \fBLWP\fRs being bound. If the
69 calling process does not have permission to change all of the specified LWPs,
70 the bindings of the LWPs for which it does have permission will be changed even
71 though an error is returned.
74 Processor bindings are inherited across \fBfork\fR(2) and \fBexec\fR(2).
77 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
78 returned and \fBerrno\fR is set to indicate the error.
81 The \fBprocessor_bind()\fR function will fail if:
88 The location pointed to by \fIobind\fR was not \fINULL\fR and not writable by
98 The processor is not on-line.
100 The LWP is bound to a processor set or resource pool for which the
101 processor is not a member.
103 The \fIidtype\fR argument is not \fBP_PID\fR, \fBP_LWPID\fR,
104 \fBP_PROJID\fR, \fBP_TASKID\fR, \fBP_CTID\fR, or \fBP_ZONEID\fR.
113 Binding a system process to a processor set is not supported.
122 The {\fBPRIV_PROC_OWNER\fR} privilege is not asserted in the effective set of
123 the calling process and its real or effective user ID does not match the real
124 or effective user \fBID\fR of one of the \fBLWP\fRs being bound.
133 No processes, \fBLWP\fRs, or tasks were found to match the criteria specified
134 by \fIidtype\fR and \fIid\fR.
138 See \fBattributes\fR(5) for descriptions of the following attributes:
146 ATTRIBUTE TYPE ATTRIBUTE VALUE
148 Interface Stability Committed
150 MT-Level Async-Signal-Safe
154 \fBpooladm\fR(8), \fBpsradm\fR(8), \fBpsrinfo\fR(8), \fBzoneadm\fR(8),
155 \fBexec\fR(2), \fBfork\fR(2), \fBp_online\fR(2), \fBpset_bind\fR(2),
156 \fBsysconf\fR(3C), \fBprocess\fR(4), \fBproject\fR(4), \fBattributes\fR(5),