OSDN Git Service

359fadf3ab5c6646b3a66a913d9fe1bf47feb7be
[linuxjm/LDP_man-pages.git] / draft / man3 / pthread_attr_setschedpolicy.3
1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .TH PTHREAD_ATTR_SETSCHEDPOLICY 3 2013\-06\-21 Linux "Linux Programmer's Manual"
32 .SH 名前
33 pthread_attr_setschedpolicy, pthread_attr_getschedpolicy \- スレッド属性
34 オブジェクトのスケジューリングポリシー属性の設定/取得を行う
35 .SH 書式
36 .nf
37 \fB#include <pthread.h>\fP
38
39 \fBint pthread_attr_setschedpolicy(pthread_attr_t *\fP\fIattr\fP\fB, int \fP\fIpolicy\fP\fB);\fP
40 \fBint pthread_attr_getschedpolicy(pthread_attr_t *\fP\fIattr\fP\fB, int \fP\fI*policy\fP\fB);\fP
41 .sp
42 \fI\-pthread\fP でコンパイルしてリンクする。
43 .fi
44 .SH 説明
45 \fBpthread_attr_setschedpolicy\fP() 関数は、
46 \fIattr\fP が参照するスレッド属性オブジェクトのスケジューリング
47 ポリシー属性を \fIpolicy\fP で指定された値に設定する。
48 この属性により、スレッド属性オブジェクト \fIattr\fP を使って
49 作成されるスレッドのスケジューリングポリシーが決定される。
50
51 .\" FIXME . pthread_setschedparam() places no restriction on the policy,
52 .\" but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
53 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=7013
54 \fIpolicy\fP に指定できる値は \fBSCHED_FIFO\fP, \fBSCHED_RR\fP, \fBSCHED_OTHER\fP
55 である。それぞれの意味は \fBsched_setscheduler\fP(2) で説明している通り
56 である。
57
58 \fBpthread_attr_getschedpolicy\fP() は、
59 スレッド属性オブジェクト \fIattr\fP のスケジューリングポリシー属性を
60 \fIpolicy\fP が指すバッファに入れて返す。
61
62 \fBpthread_create\fP(3) を呼び出した際に \fBpthread_attr_setschedpolicy\fP()
63 で行ったポリシー設定を有効にするには、 呼び出し側で \fBpthread_attr_setinheritsched\fP(3) を使って 属性オブジェクト
64 \fIattr\fP の inherit\-scheduler 属性を \fBPTHREAD_EXPLICIT_SCHED\fP に設定しておかなければならない。
65 .SH 返り値
66 成功すると、これらの関数は 0 を返す。
67 エラーの場合、0 以外のエラー番号を返す。
68 .SH エラー
69 \fBpthread_attr_setschedpolicy\fP() は以下のエラーで失敗する場合がある。
70 .TP 
71 \fBEINVAL\fP
72 \fIpolicy\fP に無効な値が指定された。
73 .PP
74 .\" .SH VERSIONS
75 .\" Available since glibc 2.0.
76 POSIX.1\-2001 では、 \fBpthread_attr_setschedpolicy\fP() に関して
77 エラー \fBENOTSUP\fP ("サポートされていない値を属性に設定しようとした")
78 も追加で規定されている。
79 .SH 準拠
80 POSIX.1\-2001.
81 .SH 例
82 \fBpthread_setschedparam\fP(3) を参照。
83 .SH 関連項目
84 .ad l
85 .nh
86 \fBsched_setscheduler\fP(2), \fBpthread_attr_init\fP(3),
87 \fBpthread_attr_setinheritsched\fP(3), \fBpthread_attr_setschedparam\fP(3),
88 \fBpthread_create\fP(3), \fBpthread_setschedparam\fP(3),
89 \fBpthread_setschedprio\fP(3), \fBpthreads\fP(7)
90 .SH この文書について
91 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
92 である。プロジェクトの説明とバグ報告に関する情報は
93 http://www.kernel.org/doc/man\-pages/ に書かれている。