Provided by: manpages-ja-dev_0.5.0.0.20221215+dfsg-1_all bug

名前

       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/ に書かれている。