OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man3 / pthread_attr_setaffinity_np.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_SETAFFINITY_NP 3 2010\-09\-10 Linux "Linux Programmer's Manual"
32 .SH 名前
33 pthread_attr_setaffinity_np, pthread_attr_getaffinity_np \-
34 スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う
35 .SH 書式
36 .nf
37 \fB#define _GNU_SOURCE\fP             /* See feature_test_macros(7) */
38 \fB#include <pthread.h>\fP
39
40 \fBint pthread_attr_setaffinity_np(pthread_attr_t *\fP\fIattr\fP\fB,\fP
41 \fB                   size_t \fP\fIcpusetsize\fP\fB, const cpu_set_t *\fP\fIcpuset\fP\fB);\fP
42 \fBint pthread_attr_getaffinity_np(pthread_attr_t *\fP\fIattr\fP\fB,\fP
43 \fB                   size_t \fP\fIcpusetsize\fP\fB, cpu_set_t *\fP\fIcpuset\fP\fB);\fP
44 .sp
45 \fI\-pthread\fP でコンパイルしてリンクする。
46 .fi
47 .SH 説明
48 \fBpthread_attr_setaffinity_np\fP() 関数は、
49 \fIattr\fP が参照するスレッド属性オブジェクトの CPU affinity マスク属性を
50 \fIcpuset\fP で指定された値に設定する。
51 この属性により、スレッド属性オブジェクト \fIattr\fP を使って
52 作成されたスレッドの CPU affinity マスクが決定される。
53
54 \fBpthread_attr_getaffinity_np\fP() 関数は、 \fIattr\fP が参照する
55 スレッド属性オブジェクトの CPU affinity マスク属性を
56 \fIcpuset\fP が指すバッファに入れて返す。
57
58 \fIcpusetsize\fP 引き数は \fIcpuset\fP が指すバッファの (バイト単位の)
59 大きさである。通常は、この引き数には \fIsizeof(cpu_set_t)\fP を
60 指定することだろう。
61
62 CPU affinity マスクの詳細については、
63 \fBsched_setaffinity\fP(2) を参照してほしい。
64 CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は
65 \fBCPU_SET\fP(3) を参照してほしい。
66 .SH 返り値
67 成功すると、これらの関数は 0 を返す。
68 エラーの場合、0 以外のエラー番号を返す。
69 .SH エラー
70 .TP 
71 \fBEINVAL\fP
72 .\" cpumask_t
73 .\" The raw sched_getaffinity() system call returns the size (in bytes)
74 .\" of the cpumask_t type.
75 (\fBpthread_attr_setaffinity_np\fP())
76 \fIcpuset\fP がカーネルがサポートする CPU 集合にない CPU を指定していた。
77 (CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲は、
78 カーネルの設定オプション \fBCONFIG_NR_CPUS\fP により定義される)。
79 .TP 
80 \fBEINVAL\fP
81 (\fBpthread_attr_getaffinity_np\fP())
82 \fIattr\fP が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、
83 \fIcpusetsize\fP により指定された範囲の中になかった
84 (すなわち、\fIcpuset\fP/\fIcpusetsize\fP が小さすぎる)。
85 .TP 
86 \fBENOMEM\fP
87 (\fBpthread_attr_setaffinity_np\fP()) メモリを割り当てることができなかった。
88 .SH バージョン
89 これらの関数は glibc バージョン 2.3.4 以降で提供されている。
90 .SH 準拠
91 これらの関数は非標準の GNU による拡張である。
92 そのため、名前に "_np" (nonportable; 移植性がない) という接尾辞が
93 付いている。
94 .SH 注意
95 (このバージョンだけであるが) glibc 2.3.3 では、
96 これらの関数は \fIcpusetsize\fP 引き数を持っていなかった。
97 内部で呼ばれるシステムコールに渡される CPU セットの大きさは
98 常に \fIsizeof(cpu_set_t)\fP であった。
99 .SH 関連項目
100 \fBsched_setaffinity\fP(2), \fBpthread_attr_init\fP(3),
101 \fBpthread_setaffinity_np\fP(3), \fBcpuset\fP(7), \fBpthreads\fP(7)
102 .SH この文書について
103 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
104 である。プロジェクトの説明とバグ報告に関する情報は
105 http://www.kernel.org/doc/man\-pages/ に書かれている。