sched_get_priority_max
Section: System Calls (2)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
sched_get_priority_max, sched_get_priority_min - 静的プライオリティの範囲を取得する
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#include <sched.h>
int sched_get_priority_max(int policy);
int sched_get_priority_min(int policy);
説明
sched_get_priority_max() はpolicy によって指定されたスケジューリングのアルゴリズムで
使用されるプライオリティの最大値を返す。 sched_get_priority_min() はpolicy
によって指定されたスケジューリングのアルゴリズムで 使用されるプライオリティの最小値を返す。 サポートされる policy の値は
SCHED_FIFO、 SCHED_RR、 SCHED_OTHER、 SCHED_BATCH, SCHED_IDLE,
SCHED_DEADLINE である。これらのスケジューリング方針に関する詳細は sched(7) に書かれている。
数値的に大きなプライオリティ値を持つプロセスは小さな プライオリティ値を持つプロセスより前にスケジュールされる。 このため
sched_get_priority_max() が返す値は sched_get_priority_min() が返す値よりも大きい。
Linux では、 ポリシー SCHED_FIFO と SCHED_RR では 1 から 99
の範囲の静的プライオリティーを持ち、それ以外のポリシーでは プライオリティとして 0 を持つ。 それぞれの方針のスケジューリングプライオリティの範囲は
変更することができない。
The range of scheduling priorities may vary on other POSIX systems, thus it
is a good idea for portable applications to use a virtual priority range and
map it to the interval given by sched_get_priority_max() and
sched_get_priority_min(). POSIX.1 requires a spread of at least 32
between the maximum and the minimum values for SCHED_FIFO and
SCHED_RR.
POSIX システムでは sched_get_priority_max() と sched_get_priority_min() は
<unistd.h> に _POSIX_PRIORITY_SCHEDULING が定義されている場合にのみ使用可能である。
返り値
On success, sched_get_priority_max() and sched_get_priority_min()
return the maximum/minimum priority value for the named scheduling policy.
On error, -1 is returned, and errno is set to indicate the error.
エラー
- EINVAL
-
引数 policy が定義されているスケジューリング方針と一致しない。
標準規格
POSIX.1-2024.
歴史
POSIX.1-2001.
関連項目
sched_getaffinity(2), sched_getparam(2), sched_getscheduler(2),
sched_setaffinity(2), sched_setparam(2), sched_setscheduler(2),
sched(7)
Index
- 名前
-
- ライブラリ
-
- 書式
-
- 説明
-
- 返り値
-
- エラー
-
- 標準規格
-
- 歴史
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.