sched_rr_get_interval

Section: System Calls (2)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

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

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <sched.h>

int sched_rr_get_interval(pid_t pid, struct timespec *tp);
 

説明

sched_rr_get_interval() writes into the timespec(3) structure pointed to by tp the round-robin time quantum for the process identified by pid. The specified process should be running under the SCHED_RR scheduling policy.

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

返り値

On success, sched_rr_get_interval() returns 0. On error, -1 is returned, and errno is set to indicate the error.  

エラー

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

バージョン

 

Linux

Linux 3.9 で、 SCHED_RR の時間量の調整 (と参照) を行う新しい機構が追加された。 /proc/sys/kernel/sched_rr_timeslice_ms ファイルでミリ秒単位の時間量の値が参照でき、 デフォルト値は 100 である。 このファイルに 0 を書き込むと、 時間量をデフォルト値に戻すことができる。  

標準規格

POSIX.1-2024.  

歴史


 POSIX.1-2001.  

Linux

POSIX ではラウンドロビン時間量の大きさを制御する仕組みが規定されていない。 古い Linux カーネルではこれを変更する方法が提供されている (この方法に移植性はない)。 プロセスの nice 値を調整することで時間量を制御できる (setpriority(2) 参照)。 負の nice 値 (すなわち、高い nice 値) を割り当てると時間量は長くなり、 正の nice 値 (すなわち、低い nice 値) を割り当てると時間量は短くなる。 デフォルトの時間量は 0.1 秒である。 nice 値の変更が時間量にどの程度影響を与えるかは カーネルのバージョンにより多少異なる。時間量を調整するこのメソッドは Linux 2.6.24 以降で削除された。  

注意

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

関連項目

timespec(3), sched(7)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
バージョン
Linux
標準規格
歴史
Linux
注意
関連項目

This document was created by man2html, using the manual pages.