8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3c / sched_setparam.3c
blob226470a8929962aa7b9eccb6913a358ac54eb163
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
4 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
7 .\"  This notice shall appear on any product containing this material.
8 .\" 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.
9 .\" 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.
10 .\" 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]
11 .TH SCHED_SETPARAM 3C "Apr 1, 2008"
12 .SH NAME
13 sched_setparam \- set scheduling parameters
14 .SH SYNOPSIS
15 .LP
16 .nf
17 #include <sched.h>
19 \fBint\fR \fBsched_setparam\fR(\fBpid_t\fR \fIpid\fR, \fBconst struct sched_param *\fR\fIparam\fR);
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fBsched_setparam()\fR function sets the scheduling parameters of the
26 process specified by \fIpid\fR to the values specified by the \fBsched_param\fR
27 structure pointed to by \fIparam\fR. The value of the \fIsched_priority\fR
28 member in the \fBsched_param\fR structure is any integer within the inclusive
29 priority range for the current scheduling policy of the process specified by
30 \fIpid\fR. Higher numerical values for the priority represent higher
31 priorities. If the value of \fIpid\fR is negative, the behavior of the
32 \fBsched_setparam()\fR function is unspecified.
33 .sp
34 .LP
35 If a process specified by \fIpid\fR exists and if the calling process has
36 permission, the scheduling parameters will be set for the process whose process
37 \fBID\fR is equal to \fIpid\fR. The real or effective user \fBID\fR of the
38 calling process must match the  real or saved (from \fBexec\fR(2)) user
39 \fBID\fR of the target process unless the effective user \fBID\fR of the
40 calling process is \fB0\fR. See \fBIntro\fR(2).
41 .sp
42 .LP
43 If \fIpid\fR is zero, the scheduling parameters will be set for the calling
44 process.
45 .sp
46 .LP
47 The target process, whether it is running or not running, resumes execution
48 after all other runnable processes of equal or greater priority have been
49 scheduled to run.
50 .sp
51 .LP
52 If the priority of the process specified by the \fIpid\fR argument is set
53 higher than that of the lowest priority running process and if the specified
54 process is ready to run, the process specified by the \fIpid\fR argument
55 preempts a lowest priority running process. Similarly, if the process calling
56 \fBsched_setparam()\fR sets its own priority lower than that of one or more
57 other non-empty process lists, then the process that is the head of the highest
58 priority list also preempts the calling process. Thus, in either case, the
59 originating process might not receive notification of the completion of the
60 requested priority change until the higher priority process has executed.
61 .SH RETURN VALUES
62 .sp
63 .LP
64 If successful, the \fBsched_setparam()\fR function returns \fB0\fR.
65 .sp
66 .LP
67 If the call to \fBsched_setparam()\fR is unsuccessful, the priority remains
68 unchanged, and the function returns \fB\(mi1\fR and sets \fBerrno\fR to
69 indicate the error.
70 .SH ERRORS
71 .sp
72 .LP
73 The \fBsched_setparam()\fR function will fail if:
74 .sp
75 .ne 2
76 .na
77 \fB\fBEINVAL\fR\fR
78 .ad
79 .RS 10n
80 One or more of the requested scheduling parameters is outside the range defined
81 for the scheduling policy of the specified \fIpid\fR.
82 .RE
84 .sp
85 .ne 2
86 .na
87 \fB\fBEPERM\fR\fR
88 .ad
89 .RS 10n
90 The requesting process does not have permission to set the scheduling
91 parameters for the specified process, or does not have the appropriate
92 privilege to invoke \fBsched_setparam()\fR.
93 .RE
95 .sp
96 .ne 2
97 .na
98 \fB\fBESRCH\fR\fR
99 .ad
100 .RS 10n
101 No process can be found corresponding to that specified by \fIpid\fR.
104 .SH ATTRIBUTES
107 See \fBattributes\fR(5) for descriptions of the following attributes:
112 box;
113 c | c
114 l | l .
115 ATTRIBUTE TYPE  ATTRIBUTE VALUE
117 Interface Stability     Committed
119 MT-Level        MT-Safe
121 Standard        See \fBstandards\fR(5).
124 .SH SEE ALSO
127 \fBIntro\fR(2), \fBexec\fR(2), \fBlibrt\fR(3LIB), \fBsched.h\fR(3HEAD),
128 \fBsched_getparam\fR(3C), \fBsched_getscheduler\fR(3C),
129 \fBsched_setscheduler\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)