.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk .\" .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2012 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2012-05-03, Akihiro MOTOKI .\" Updated 2013-07-31, Akihiro MOTOKI .\" .TH PTHREAD_ATTR_SETSCHEDPOLICY 3 2014\-05\-21 Linux "Linux Programmer's Manual" .SH 名前 pthread_attr_setschedpolicy, pthread_attr_getschedpolicy \- スレッド属性 オブジェクトのスケジューリングポリシー属性の設定/取得を行う .SH 書式 .nf \fB#include \fP \fBint pthread_attr_setschedpolicy(pthread_attr_t *\fP\fIattr\fP\fB, int \fP\fIpolicy\fP\fB);\fP \fBint pthread_attr_getschedpolicy(const pthread_attr_t *\fP\fIattr\fP\fB, int \fP\fI*policy\fP\fB);\fP .sp \fI\-pthread\fP でコンパイルしてリンクする。 .fi .SH 説明 \fBpthread_attr_setschedpolicy\fP() 関数は、 \fIattr\fP が参照するスレッド属性オブジェクトのスケジューリング ポリシー属性を \fIpolicy\fP で指定された値に設定する。 この属性により、スレッド属性オブジェクト \fIattr\fP を使って 作成されるスレッドのスケジューリングポリシーが決定される。 .\" FIXME . pthread_setschedparam() places no restriction on the policy, .\" but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER .\" http://sourceware.org/bugzilla/show_bug.cgi?id=7013 \fIpolicy\fP に指定できる値は \fBSCHED_FIFO\fP, \fBSCHED_RR\fP, \fBSCHED_OTHER\fP である。それぞれの意味は \fBsched\fP(7) で説明している通りである。 \fBpthread_attr_getschedpolicy\fP() は、 スレッド属性オブジェクト \fIattr\fP のスケジューリングポリシー属性を \fIpolicy\fP が指すバッファーに入れて返す。 \fBpthread_create\fP(3) を呼び出した際に \fBpthread_attr_setschedpolicy\fP() で行ったポリシー設定を有効にするには、 呼び出し側で \fBpthread_attr_setinheritsched\fP(3) を使って 属性オブジェクト \fIattr\fP の inherit\-scheduler 属性を \fBPTHREAD_EXPLICIT_SCHED\fP に設定しておかなければならない。 .SH 返り値 成功すると、これらの関数は 0 を返す。 エラーの場合、0 以外のエラー番号を返す。 .SH エラー \fBpthread_attr_setschedpolicy\fP() は以下のエラーで失敗する場合がある。 .TP \fBEINVAL\fP \fIpolicy\fP に無効な値が指定された。 .PP .\" .SH VERSIONS .\" Available since glibc 2.0. POSIX.1\-2001 では、 \fBpthread_attr_setschedpolicy\fP() に関して エラー \fBENOTSUP\fP ("サポートされていない値を属性に設定しようとした") も追加で規定されている。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" 関数 \fBpthread_attr_setschedpolicy\fP() と \fBpthread_attr_getschedpolicy\fP() はスレッドセーフである。 .SH 準拠 POSIX.1\-2001. .SH 例 \fBpthread_setschedparam\fP(3) を参照。 .SH 関連項目 .ad l .nh \fBpthread_attr_init\fP(3), \fBpthread_attr_setinheritsched\fP(3), \fBpthread_attr_setschedparam\fP(3), \fBpthread_create\fP(3), \fBpthread_setschedparam\fP(3), \fBpthread_setschedprio\fP(3), \fBpthreads\fP(7), \fBsched\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。