1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, write to the Free
22 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
25 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
26 .\" First version written
27 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
29 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
31 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
32 .\" all rights reserved.
33 .\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
34 .\" Updated & Modified 2005-02-10, Yuichi SATO <ysato444@yahoo.co.jp>
35 .\" Updated & Modified 2005-10-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\" Updated 2006-04-14, Akihiro MOTOKI, LDP v2.29
38 .\"WORD: process ¥×¥í¥»¥¹
39 .\"WORD: scheduling ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°
41 .\"WORD: implement ¼ÂÁõ
42 .\"WORD: parameter ¥Ñ¥é¥á¡¼¥¿
43 .\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID
45 .TH SCHED_SETPARAM 2 2006-03-23 "Linux" "Linux Programmer's Manual"
48 .\"O sched_setparam, sched_getparam \- set and get scheduling parameters
49 sched_setparam, sched_getparam \- ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤Ê¤¦
55 .BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param );
57 .BI "int sched_getparam(pid_t " pid ", struct sched_param *" param );
61 \fBstruct sched_param {
63 int \fIsched_priority\fB;
69 .\"O .BR sched_setparam ()
70 .\"O sets the scheduling parameters associated with the scheduling policy
71 .\"O for the process identified by \fIpid\fP.
72 .\"O If \fIpid\fP is zero, then
73 .\"O the parameters of the calling process are set.
74 .\"O The interpretation of
75 .\"O the argument \fIparam\fP depends on the scheduling
76 .\"O policy of the process identified by
79 .\"O .BR sched_setscheduler (2)
80 .\"O for a description of the scheduling policies supported under Linux.
82 ¤Ï \fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë (scheduling policy) ¤Ë
83 ´ØÏ¢¤¹¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ë¡£
84 \fIpid\fP ¤¬ 0 ¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤¬ÀßÄꤵ¤ì¤ë¡£
85 °ú¤¿ô \fIparam\fP ¤Î²ò¼á¤Ï¡¢
87 ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
88 Linux ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤ÎÀâÌÀ¤Ï
89 .BR sched_setscheduler (2)
92 .\"O .BR sched_getparam ()
93 .\"O retrieves the scheduling parameters for the
94 .\"O process identified by \fIpid\fP.
95 .\"O If \fIpid\fP is zero, then the parameters
96 .\"O of the calling process are retrieved.
98 ¤Ï \fIpid\fP ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¡¦¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤¹¤ë¡£
99 \fIpid\fP ¤¬ 0 ¤Ê¤é¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤¹¤ë¡£
101 .\"O .BR sched_setparam ()
102 .\"O checks the validity of \fIparam\fP for the scheduling policy of the
104 .\"O The value \fIparam\->sched_priority\fP must lie within the
106 .\"O .BR sched_get_priority_min (2)
108 .\"O .BR sched_get_priority_max (2).
109 .BR sched_setparam ()
110 ¤Ï¥×¥í¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ë¤ª¤±¤ë \fIparam\fP ¤ÎÂÅÅöÀ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£
111 \fIparam\->sched_priority\fP ¤ÎÃͤÏ
112 .BR sched_get_priority_min (2)
114 .BR sched_get_priority_max (2)
115 ¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
117 .\"O For a discussion of the privileges and resource limits related to
118 .\"O scheduling priority and policy, see
119 .\"O .BR sched_setscheduler (2).
120 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÎÍ¥ÀèÅÙ¤ÈÊý¿Ë¤Ë´ØÏ¢¤¹¤ëÆø¢¤È¥ê¥½¡¼¥¹À©¸Â¤Î
122 .BR sched_setscheduler (2)
125 .\"O POSIX systems on which
126 .\"O .BR sched_setparam ()
128 .\"O .BR sched_getparam ()
129 .\"O are available define
130 .\"O .B _POSIX_PRIORITY_SCHEDULING
131 .\"O in \fI<unistd.h>\fP.
132 .BR sched_setparam ()
134 .BR sched_getparam ()
135 ¤¬»ÈÍѤǤ¤ë POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
138 .B _POSIX_PRIORITY_SCHEDULING
140 .\"O .SH "RETURN VALUE"
143 .\"O .BR sched_setparam ()
145 .\"O .BR sched_getparam ()
148 .BR sched_setparam ()
150 .BR sched_getparam ()
152 .\"O On error, \-1 is returned, and
154 .\"O is set appropriately.
155 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
162 .\"O The argument \fIparam\fP does not make sense for the current
163 .\"O scheduling policy.
164 °ú¤¿ô \fIparam\fP ¤¬¸½ºß¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ë¤ª¤¤¤Æ¤Ï
168 .\"O The calling process does not have appropriate privileges
169 .\"O (Linux: does not have the
172 ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬Å¬ÀÚ¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤
175 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤)¡£
178 .\"O The process whose ID is \fIpid\fP could not be found.
179 \fIpid\fP ¤ò ID ¤Ë»ý¤Ä¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£
180 .\"O .SH "CONFORMING TO"
187 .BR sched_get_priority_max (2),
188 .BR sched_get_priority_min (2),
189 .BR sched_getaffinity (2),
190 .BR sched_getscheduler (2),
191 .BR sched_setaffinity (2),
192 .BR sched_setscheduler (2),
196 .I Programming for the real world \- POSIX.4
197 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0