1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 1989 AT&T
.\" 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. 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 the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH PRIOCNTLSET 2 "Apr 1, 2008"
.SH NAME
priocntlset \- generalized process scheduler control
.SH SYNOPSIS
.LP
.nf
#include <sys/types.h>
#include <sys/procset.h>
#include <sys/priocntl.h>
#include <sys/rtpriocntl.h>
#include <sys/tspriocntl.h>
#include <sys/iapriocntl.h>
#include <sys/fsspriocntl.h>
#include <sys/fxpriocntl.h>
\fBlong\fR \fBpriocntlset\fR(\fBprocset_t *\fR\fIpsp\fR, \fBint\fR \fIcmd\fR, \fB/*\fR \fIarg\fR */ ...);
.fi
.SH DESCRIPTION
.sp
.LP
The \fBpriocntlset()\fR function changes the scheduling properties of running
processes. \fBpriocntlset()\fR has the same functions as the \fBpriocntl()\fR
function, but a more general way of specifying the set of processes whose
scheduling properties are to be changed.
.sp
.LP
\fIcmd\fR specifies the function to be performed. \fIarg\fR is a pointer to a
structure whose type depends on \fIcmd\fR. See \fBpriocntl\fR(2) for the valid
values of \fIcmd\fR and the corresponding \fIarg\fR structures.
.sp
.LP
\fIpsp\fR is a pointer to a \fBprocset\fR structure, which \fBpriocntlset()\fR
uses to specify the set of processes whose scheduling properties are to be
changed. The \fBprocset\fR structure contains the following members:
.sp
.in +2
.nf
idop_t p_op; /* operator connecting left/right sets */
idtype_t p_lidtype; /* left set ID type */
id_t p_lid; /* left set ID */
idtype_t p_ridtype; /* right set ID type */
id_t p_rid; /* right set ID */
.fi
.in -2
.sp
.LP
The \fBp_lidtype\fR and \fBp_lid\fR members specify the \fBID\fR type and
\fBID\fR of one ("left") set of processes; the \fBp_ridtype\fR and \fBp_rid\fR
members specify the \fBID\fR type and \fBID\fR of a second ("right") set of
processes. \fBID\fR types and \fBID\fRs are specified just as for the
\fBpriocntl()\fR function. The \fBp_op\fR member specifies the operation to be
performed on the two sets of processes to get the set of processes the function
is to apply to. The valid values for \fBp_op\fR and the processes they specify
are:
.sp
.ne 2
.na
\fB\fBPOP_DIFF\fR\fR
.ad
.RS 12n
Set difference: processes in left set and not in right set.
.RE
.sp
.ne 2
.na
\fB\fBPOP_AND\fR\fR
.ad
.RS 12n
Set intersection: processes in both left and right sets.
.RE
.sp
.ne 2
.na
\fB\fBPOP_OR\fR\fR
.ad
.RS 12n
Set union: processes in either left or right sets or both.
.RE
.sp
.ne 2
.na
\fB\fBPOP_XOR\fR\fR
.ad
.RS 12n
Set exclusive-or: processes in left or right set but not in both.
.RE
.sp
.LP
The following macro, which is defined in <\fBprocset.h\fR>, offers a convenient
way to initialize a \fBprocset\fR structure:
.sp
.in +2
.nf
#define setprocset(psp, op, ltype, lid, rtype, rid) \e
(psp)->p_op = (op), \e
(psp)->p_lidtype = (ltype), \e
(psp)->p_lid = (lid), \e
(psp)->p_ridtype = (rtype), \e
(psp)->p_rid = (rid),
.fi
.in -2
.SH RETURN VALUES
.sp
.LP
Unless otherwise noted above, \fBpriocntlset()\fR returns \fB0\fR on success.
Otherwise, it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
.SH ERRORS
.sp
.LP
The \fBpriocntlset()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBEAGAIN\fR\fR
.ad
.RS 10n
An attempt to change the class of a process failed because of insufficient
resources other than memory (for example, class-specific kernel data
structures).
.RE
.sp
.ne 2
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 10n
One of the arguments points to an illegal address.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
The argument \fIcmd\fR was invalid, an invalid or unconfigured class was
specified, or one of the parameters specified was invalid.
.RE
.sp
.ne 2
.na
\fB\fBENOMEM\fR\fR
.ad
.RS 10n
An attempt to change the class of a process failed because of insufficient
memory.
.RE
.sp
.ne 2
.na
\fB\fBEPERM\fR\fR
.ad
.RS 10n
The {\fBPRIV_PROC_PRIOCNTL\fR} privilege is not asserted in the effective set
of the calling LWP.
.sp
The calling LWP does not have sufficient privileges to affect the target LWP.
.RE
.sp
.ne 2
.na
\fB\fBERANGE\fR\fR
.ad
.RS 10n
The requested time quantum is out of range.
.RE
.sp
.ne 2
.na
\fB\fBESRCH\fR\fR
.ad
.RS 10n
None of the specified processes exist.
.RE
.SH SEE ALSO
.sp
.LP
.BR priocntl (1),
.BR priocntl (2)
|