1 '\" te
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 "Mar 13, 2009"
7 .SH NAME
8 processor_bind \- bind LWPs to a processor
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/types.h>
13 #include <sys/processor.h>
14 #include <sys/procset.h>
15
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);
18 .fi
19
20 .SH DESCRIPTION
21 .sp
22 .LP
23 The \fBprocessor_bind()\fR function binds the LWP (lightweight process) or set
24 of LWPs specified by \fIidtype\fR and \fIid\fR to the processor specified by
25 \fIprocessorid\fR. If \fIobind\fR is not \fINULL\fR, this function also sets
26 the \fBprocessorid_t\fR variable pointed to by \fIobind\fR to the previous
27 binding of one of the specified LWPs, or to \fBPBIND_NONE\fR if the selected
28 LWP was not bound.
29 .sp
30 .LP
31 If \fIidtype\fR is \fBP_PID\fR, the binding affects all LWPs of the process
32 with process ID (PID) \fIid\fR.
33 .sp
34 .LP
35 If \fIidtype\fR is \fBP_LWPID\fR, the binding affects the LWP of the current
36 process with LWP ID \fIid\fR.
37 .sp
38 .LP
39 If \fIidtype\fR is \fBP_TASKID\fR, the binding affects all LWPs of all
40 processes with task ID \fIid\fR.
41 .sp
57 .sp
58 .LP
59 If \fIprocessorid\fR is \fBPBIND_NONE\fR, the processor bindings of the
60 specified LWPs are cleared.
61 .sp
62 .LP
63 If \fIprocessorid\fR is \fBPBIND_QUERY\fR, the processor bindings are not
64 changed.
65 .sp
66 .LP
67 The {\fBPRIV_PROC_OWNER\fR} privilege must be asserted in the effective set of
68 the calling process or the real or effective user ID of the calling process
69 must match the real or effective user ID of the \fBLWP\fRs being bound. If the
70 calling process does not have permission to change all of the specified LWPs,
71 the bindings of the LWPs for which it does have permission will be changed even
72 though an error is returned.
73 .sp
74 .LP
75 Processor bindings are inherited across \fBfork\fR(2) and \fBexec\fR(2).
76 .SH RETURN VALUES
77 .sp
78 .LP
79 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
80 returned and \fBerrno\fR is set to indicate the error.
81 .SH ERRORS
82 .sp
83 .LP
84 The \fBprocessor_bind()\fR function will fail if:
85 .sp
86 .ne 2
87 .na
88 \fB\fBEFAULT\fR\fR
89 .ad
90 .RS 11n
91 The location pointed to by \fIobind\fR was not \fINULL\fR and not writable by
92 the user.
93 .RE
94
95 .sp
96 .ne 2
97 .na
98 \fB\fBEINVAL\fR\fR
99 .ad
100 .RS 11n
101 The specified processor is not on-line, or the \fIidtype\fR argument was not
102 \fBP_PID\fR, \fBP_LWPID\fR, \fBP_PROJID\fR, \fBP_TASKID\fR, \fBP_CTID\fR, or
103 \fBP_ZONEID\fR.
104 .sp
105 The caller is in a non-global zone, the pools facility is active, and the
106 processor is not a member of the zone's pool's processor set.
107 .RE
108
109 .sp
110 .ne 2
111 .na
112 \fB\fBENOTSUP\fR\fR
113 .ad
114 .RS 11n
115 Binding a system process to a processor set is not supported.
116 .RE
117
118 .sp
119 .ne 2
120 .na
121 \fB\fBEPERM\fR\fR
122 .ad
123 .RS 11n
124 The {\fBPRIV_PROC_OWNER\fR} privilege is not asserted in the effective set of
125 the calling process and its real or effective user ID does not match the real
126 or effective user \fBID\fR of one of the \fBLWP\fRs being bound.
127 .RE
128
129 .sp
130 .ne 2
131 .na
132 \fB\fBESRCH\fR\fR
133 .ad
134 .RS 11n
135 No processes, \fBLWP\fRs, or tasks were found to match the criteria specified
136 by \fIidtype\fR and \fIid\fR.
137 .RE
138
139 .SH ATTRIBUTES
140 .sp
141 .LP
142 See \fBattributes\fR(5) for descriptions of the following attributes:
143 .sp
144
145 .sp
146 .TS
147 box;
148 c | c
149 l | l .
150 ATTRIBUTE TYPE ATTRIBUTE VALUE
151 _
152 Interface Stability Committed
153 _
154 MT-Level Async-Signal-Safe
155 .TE
156
157 .SH SEE ALSO
158 .sp
159 .LP
160 \fBpooladm\fR(1M), \fBpsradm\fR(1M), \fBpsrinfo\fR(1M), \fBzoneadm\fR(1M),
161 \fBexec\fR(2), \fBfork\fR(2), \fBp_online\fR(2), \fBpset_bind\fR(2),
162 \fBsysconf\fR(3C), \fBprocess\fR(4), \fBproject\fR(4), \fBattributes\fR(5),
163 \fBprivileges\fR(5)
|
1 '\" te
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"
7 .SH NAME
8 processor_bind \- bind LWPs to a processor
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/types.h>
13 #include <sys/processor.h>
14 #include <sys/procset.h>
15
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);
18 .fi
19
20 .SH DESCRIPTION
21 .LP
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
27 LWP was not bound.
28 .sp
29 .LP
30 If \fIidtype\fR is \fBP_PID\fR, the binding affects all LWPs of the process
31 with process ID (PID) \fIid\fR.
32 .sp
33 .LP
34 If \fIidtype\fR is \fBP_LWPID\fR, the binding affects the LWP of the current
35 process with LWP ID \fIid\fR.
36 .sp
37 .LP
38 If \fIidtype\fR is \fBP_TASKID\fR, the binding affects all LWPs of all
39 processes with task ID \fIid\fR.
40 .sp
56 .sp
57 .LP
58 If \fIprocessorid\fR is \fBPBIND_NONE\fR, the processor bindings of the
59 specified LWPs are cleared.
60 .sp
61 .LP
62 If \fIprocessorid\fR is \fBPBIND_QUERY\fR, the processor bindings are not
63 changed.
64 .sp
65 .LP
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.
72 .sp
73 .LP
74 Processor bindings are inherited across \fBfork\fR(2) and \fBexec\fR(2).
75 .SH RETURN VALUES
76 .LP
77 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
78 returned and \fBerrno\fR is set to indicate the error.
79 .SH ERRORS
80 .LP
81 The \fBprocessor_bind()\fR function will fail if:
82 .sp
83 .ne 2
84 .na
85 \fB\fBEFAULT\fR\fR
86 .ad
87 .RS 11n
88 The location pointed to by \fIobind\fR was not \fINULL\fR and not writable by
89 the user.
90 .RE
91
92 .sp
93 .ne 2
94 .na
95 \fB\fBEINVAL\fR\fR
96 .ad
97 .RS 11n
98 The processor is not on-line.
99 .sp
100 The LWP is bound to a processor set or resource pool for which the
101 processor is not a member.
102 .sp
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.
105 .RE
106
107 .sp
108 .ne 2
109 .na
110 \fB\fBENOTSUP\fR\fR
111 .ad
112 .RS 11n
113 Binding a system process to a processor set is not supported.
114 .RE
115
116 .sp
117 .ne 2
118 .na
119 \fB\fBEPERM\fR\fR
120 .ad
121 .RS 11n
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.
125 .RE
126
127 .sp
128 .ne 2
129 .na
130 \fB\fBESRCH\fR\fR
131 .ad
132 .RS 11n
133 No processes, \fBLWP\fRs, or tasks were found to match the criteria specified
134 by \fIidtype\fR and \fIid\fR.
135 .RE
136
137 .SH ATTRIBUTES
138 See \fBattributes\fR(5) for descriptions of the following attributes:
139 .sp
140
141 .sp
142 .TS
143 box;
144 c | c
145 l | l .
146 ATTRIBUTE TYPE ATTRIBUTE VALUE
147 _
148 Interface Stability Committed
149 _
150 MT-Level Async-Signal-Safe
151 .TE
152
153 .SH SEE ALSO
154 \fBpooladm\fR(1M), \fBpsradm\fR(1M), \fBpsrinfo\fR(1M), \fBzoneadm\fR(1M),
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),
157 \fBprivileges\fR(5)
|