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>
30 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
31 .\" all rights reserved.
32 .\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
33 .\" Updated 2003-10-11, Kentaro Shirakata <argrath@ub32.org>
34 .\" Updated 2007-05-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.48
37 .\"WORD: round robin ラウンド・ロビン
39 .\"WORD: scheduling スケジューリング
43 .TH SCHED_RR_GET_INTERVAL 2 2007-04-06 "Linux" "Linux Programmer's Manual"
46 .\"O sched_rr_get_interval \- get the SCHED_RR interval for the named process
47 sched_rr_get_interval \- 指定されたプロセスの SCHED_RR 間隔を取得する
52 .BI "int sched_rr_get_interval(pid_t " pid ", struct timespec *" tp );
55 .\"O .BR sched_rr_get_interval ()
56 .\"O writes into the \fItimespec\fP structure pointed to by \fItp\fP the
57 .\"O round robin time quantum for the process identified by \fIpid\fP.
58 .BR sched_rr_get_interval ()
59 は \fItp\fP で指定された \fItimespec\fP 構造体に
60 \fIpid\fP で指定されたプロセスのラウンド・ロビン時間量
61 (round robin time quantum) を書き込む。
63 .\"O The \fItimespec\fP structure has the following form:
64 \fItimespec\fP 構造体は以下の通りである:
69 time_t tv_sec; /* seconds */
70 long tv_nsec; /* nanoseconds */
76 .\"O \fIpid\fP is zero, the time quantum for the calling process is written
78 .\"O The identified process should be running under the
80 .\"O scheduling policy.
81 \fIpid\fP がゼロの場合、呼び出したプロセスの時間量が
82 \fI*tp\fP に書き込まれる。指定したプロセスは
84 スケジューリング方針で稼動している必要がある。
85 .\" FIXME . On Linux, sched_rr_get_interval()
86 .\" returns the timeslice for SCHED_OTHER processes -- this timeslice
87 .\" is influenced by the nice value.
88 .\" For SCHED_FIFO processes, this always returns 0.
90 .\"O .\" The round robin time quantum value is not alterable under Linux
92 .\" ラウンド・ロビン時間量は Linux 1.3.81 では変更できない。
94 .\"O POSIX systems on which
95 .\"O .BR sched_rr_get_interval ()
96 .\"O is available define
97 .\"O .B _POSIX_PRIORITY_SCHEDULING
98 .\"O in \fI<unistd.h>\fP.
99 .BR sched_rr_get_interval ()
103 .B _POSIX_PRIORITY_SCHEDULING
105 .\"O .SH "RETURN VALUE"
108 .\"O .BR sched_rr_get_interval ()
110 .\"O On error, \-1 is returned, and
112 .\"O is set appropriately.
114 .BR sched_rr_get_interval ()
123 .\"O Problem with copying information to userspace.
124 情報をユーザ空間にコピーする時に問題が起きた。
131 .\"O The system call is not yet implemented (only on rather old kernels).
132 システム・コールがまだ実装されていない (かなり古いカーネルにおいてのみ)。
135 .\"O The process whose ID is \fIpid\fP could not be found.
136 \fIpid\fP の ID を持つプロセスが見つからなかった。
137 .\"O .SH "CONFORMING TO"
145 .\" From at least Linux 2.6.9, the following is no longer true
146 .\" for SCHED_RR processes. For RR processes the timeslice is always
147 .\" DEF_TIMESLICE, or 0.1 secs.
148 .\" Was the following really true for older kernels?
149 .\" Must build a 2.6.8 kernel and retest, and rewrite the following text
151 .\"O POSIX does not specify any mechanism for controlling the size of the
152 .\"O round-robin time quantum.
153 .\"O However, Linux provides a (nonportable) method of doing this.
154 .\"O The quantum can be controlled by adjusting the process's nice value (see
155 .\"O .BR setpriority (2)).
156 .\"O Assigning a negative (i.e., high) nice value results in a longer quantum;
157 .\"O assigning a positive (i.e., low) nice value results in a shorter quantum.
158 .\"O The default quantum is 0.1 seconds;
159 .\"O the degree to which changing the nice value affects the
160 .\"O quantum has varied somewhat across kernel versions.
161 POSIX ではラウンド・ロビン時間量の大きさを制御する仕組みが規定されていない。
162 しかし、Linux ではこれを変更する方法が提供されており (この方法に移植性はない)、
163 プロセスの nice 値を調整することで時間量を制御できる
164 .RB ( setpriority (2)
166 負の nice 値 (すなわち、高い nice 値) を割り当てると時間量は長くなり、
167 正の nice 値 (すなわち、低い nice 値) を割り当てると時間量は短くなる。
169 nice 値の変更が時間量にどの程度影響を与えるかは
173 .\"O .\" As of Linux 1.3.81
174 .\"O .\" .BR sched_rr_get_interval ()
175 .\"O .\" returns with error
176 .\"O .\" ENOSYS, because SCHED_RR has not yet been fully implemented and tested
178 .\" Linux 1.3.81 の時点では
179 .\" .BR sched_rr_get_interval ()
181 .\" これは SCHED_RR はまだ完全には実装されておらず、
182 .\" 適切にテストされていないからである。
185 .\"O .BR sched_setscheduler (2)
186 .\"O has a description of the Linux scheduling scheme.
187 .BR sched_setscheduler (2)
188 に Linux のスケジューリング方式についての説明がある。
190 .I Programming for the real world \- POSIX.4
191 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0