SCHED_SETPARAM

Section: Linux Programmer's Manual (2)
Updated: 2019-10-10
Index JM Home Page
 

名前

sched_setparam, sched_getparam - スケジューリングパラメーターの設定と取得を行なう  

書式

#include <sched.h>

int sched_setparam(pid_t pid, const struct sched_param *param);

int sched_getparam(pid_t pid, struct sched_param *param);

struct sched_param {
    ...
    int sched_priority;
    ...
};
 

説明

sched_setparam() sets the scheduling parameters associated with the scheduling policy for the thread whose thread ID is specified in pid. If pid is zero, then the parameters of the calling thread are set. The interpretation of the argument param depends on the scheduling policy of the thread identified by pid. See sched(7) for a description of the scheduling policies supported under Linux.

sched_getparam() は pid で指定されたスレッドのスケジューリングパラメーターを取得する。 pid が 0 ならば、呼び出し元のスレッドのパラメーターを取得する。

sched_setparam() はスレッドのスケジューリング方針における param の妥当性をチェックする。 param->sched_priority の値は sched_get_priority_min(2) と sched_get_priority_max(2) の範囲に入っていなければならない。

スケジューリングの優先度と方針に関連する特権とリソース制限の 議論に関しては sched(7) を参照のこと。

sched_setparam() と sched_getparam() が使用できる POSIX システムでは、 <unistd.h>_POSIX_PRIORITY_SCHEDULING が定義されている。  

返り値

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

エラー

EINVAL
無効な引数: param が NULL である、または pid が負である。
EINVAL
(sched_setparam()) 引数 param が現在のスケジューリング方針においては 無意味である。
EPERM
(sched_setparam()) 呼び出し元が適切な特権を持っていない (Linux では、 CAP_SYS_NICE ケーパビリティを持っていない)。
ESRCH
ID が pid のスレッドが見つからなかった。
 

準拠


 POSIX.1-2001, POSIX.1-2008.  

関連項目


 getpriority(2), gettid(2), nice(2), sched_get_priority_max(2), sched_get_priority_min(2), sched_getaffinity(2), sched_getscheduler(2), sched_setaffinity(2), sched_setattr(2), sched_setscheduler(2), setpriority(2), capabilities(7), sched(7)  

この文書について

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

関連キーワード

sched, pid, param, setparam, SCHED, SETPARAM, priority, getparam, スケジューリング, scheduling

Linux マニュアル 一覧

[man1] [man2] [man3] [man4] [man5] [man6] [man7] [man8]
[a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]

 

Index

名前
書式
説明
返り値
エラー
準拠
関連項目
この文書について

This document was created by man2html, using the manual pages.
Time: 12:08:48 GMT, June 11, 2022