EN JA
SCHED_RR_GET_INTERVAL(2)
SCHED_RR_GET_INTERVAL(2) Linux Programmer's Manual SCHED_RR_GET_INTERVAL(2)

名前

sched_rr_get_interval -指定されたプロセスの SCHED_RR 間隔を取得する

書式

#include <sched.h>
 
int sched_rr_get_interval(pid_t pid , struct timespec * tp );

説明

sched_rr_get_interval() は tp で指定された timespec 構造体に pid で指定されたプロセスのラウンドロビン時間量 (round robin time quantum) を書き込む。指定されたプロセスは SCHED_RR スケジューリングポリシーで動作しているはずである。
 
timespec 構造体は以下の通りである:
 


struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};

 
pid が 0 の場合、呼び出したプロセスの時間量 (time quantum) が *tp に書き込まれる。

返り値

成功した場合は sched_rr_get_interval() は 0 を返す。エラーの場合は-1 が返され、 errno が適切に設定される。

エラー

EFAULT
情報をユーザ空間にコピーする時に問題が起きた。
EINVAL
PID が不正である。
ENOSYS
システム・コールがまだ実装されていない (かなり古いカーネルにおいてのみ)。
ESRCH
プロセス ID が pid のプロセスが見つからなかった。

準拠

POSIX.1-2001.

注意

POSIX システムで sched_rr_get_interval() は <unistd.h>_POSIX_PRIORITY_SCHEDULING が定義されている場合にのみ使用可能である。

Linux での注意

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 setpriority(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.
 
Linux 3.9 added a new mechanism for adjusting (and viewing) the SCHED_RR quantum: the /proc/sys/kernel/sched_rr_timeslice_ms file exposes the quantum as a millisecond value, whose default is 100. Writing 0 to this file resets the quantum to the default value.

関連項目

sched_setscheduler(2) に Linux のスケジューリング方式についての説明がある。

Programming for the real world - POSIX.4 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0.

この文書について

この man ページは Linux man-pages プロジェクトのリリース 3.51 の一部である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man-pages/ に書かれている。
2013-03-18 Linux