.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996 .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" 1996-04-01 Tom Bjorkholm .\" First version written .\" 1996-04-10 Markus Kuhn .\" revision .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH SCHED_RR_GET_INTERVAL 2 2013\-03\-18 Linux "Linux Programmer's Manual" .SH 名前 sched_rr_get_interval \- 指定されたプロセスの SCHED_RR 間隔を取得する .SH 書式 \fB#include \fP .sp \fBint sched_rr_get_interval(pid_t \fP\fIpid\fP\fB, struct timespec *\fP\fItp\fP\fB);\fP .SH 説明 \fBsched_rr_get_interval\fP() は \fItp\fP で指定された \fItimespec\fP 構造体に \fIpid\fP で指定されたプロセスのラウンドロビン時間量 (round robin time quantum) を書き込む。指定されたプロセスは \fBSCHED_RR\fP スケジューリング ポリシーで動作しているはずである。 \fItimespec\fP 構造体は以下の通りである: .in +4n .nf struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; .fi .in .\" FIXME . On Linux, sched_rr_get_interval() .\" returns the timeslice for SCHED_OTHER processes -- this timeslice .\" is influenced by the nice value. .\" For SCHED_FIFO processes, this always returns 0. .\" .\" The round-robin time quantum value is not alterable under Linux .\" 1.3.81. .\" \fIpid\fP が 0 の場合、呼び出したプロセスの時間量 (time quantum) が \fI*tp\fP に書き込まれる。 .SH 返り値 成功した場合は \fBsched_rr_get_interval\fP() は 0 を返す。 エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー .TP \fBEFAULT\fP 情報をユーザ空間にコピーする時に問題が起きた。 .TP \fBEINVAL\fP PID が不正である。 .TP \fBENOSYS\fP システム・コールがまだ実装されていない (かなり古いカーネルにおいてのみ)。 .TP \fBESRCH\fP プロセス ID が \fIpid\fP のプロセスが見つからなかった。 .SH 準拠 POSIX.1\-2001. .SH 注意 POSIX システムで \fBsched_rr_get_interval\fP() は \fI\fP に \fB_POSIX_PRIORITY_SCHEDULING\fP が定義されている場合にのみ使用可能である。 .SS "Linux での注意" .\" commit a4ec24b48ddef1e93f7578be53270f0b95ad666c POSIX does not specify any mechanism for controlling the size of the round\-robin time quantum. Older Linux kernels provide a (nonportable) method of doing this. The quantum can be controlled by adjusting the process's nice value (see \fBsetpriority\fP(2)). Assigning a negative (i.e., high) nice value results in a longer quantum; assigning a positive (i.e., low) nice value results in a shorter quantum. The default quantum is 0.1 seconds; the degree to which changing the nice value affects the quantum has varied somewhat across kernel versions. This method of adjusting the quantum was removed starting with Linux 2.6.24. .\" commit ce0dbbbb30aee6a835511d5be446462388ba9eee .\" .SH BUGS .\" As of Linux 1.3.81 .\" .BR sched_rr_get_interval () .\" returns with error .\" ENOSYS, because SCHED_RR has not yet been fully implemented and tested .\" properly. Linux 3.9 added a new mechanism for adjusting (and viewing) the \fBSCHED_RR\fP quantum: the \fI/proc/sys/kernel/sched_rr_timeslice_ms\fP file exposes the quantum as a millisecond value, whose default is 100. Writing 0 to this file resets the quantum to the default value. .SH 関連項目 \fBsched_setscheduler\fP(2) に Linux のスケジューリング方式についての説明 がある。 .PP \fIProgramming for the real world \- POSIX.4\fP by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1\-56592\-074\-0. .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.51 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。