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