OSDN Git Service

fac55431db0e338deb210dd8d2adda9bb21aedc0
[linuxjm/LDP_man-pages.git] / draft / man3 / sched_getcpu.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 SCHED_GETCPU 3 2013\-04\-17 Linux "Linux Programmer's Manual"
32 .SH 名前
33 sched_getcpu \- 呼び出したスレッドが実行されている CPU を知る
34 .SH 書式
35 .nf
36 \fB#include <sched.h>\fP
37
38 \fBint sched_getcpu(void);\fP
39 .fi
40 .sp
41 .in -4n
42 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
43 .in
44 .sp
45 \fBsched_getcpu\fP():
46 .ad l
47 .RS 4
48 .PD 0
49 .TP  4
50 glibc 2.14 以降:
51 _GNU_SOURCE
52 .TP  4
53 glibc 2.14 より前:
54 _BSD_SOURCE || _SVID_SOURCE
55     /* _GNU_SOURCE も定義される */
56 .PD
57 .RE
58 .ad b
59 .SH 説明
60 \fBsched_getcpu\fP()  は、呼び出したスレッドが現在実行されている CPU の番号を返す。
61 .SH 返り値
62 成功すると、 \fBsched_getcpu\fP()  は非負の CPU 番号を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP
63 にエラーを示す値を設定する。
64 .SH エラー
65 .TP 
66 \fBENOSYS\fP
67 このカーネルでは \fBgetcpu\fP(2)  が実装されていない。
68 .SH バージョン
69 この関数は glibc 2.6 以降で利用可能である。
70 .SH 準拠
71 \fBsched_getcpu\fP()  は glibc 固有である。
72 .SH 注意
73 呼び出し
74 .in +4n
75 .nf
76
77 cpu = sched_getcpu();
78
79 .fi
80 .in
81 は、以下の \fBgetcpu\fP(2)  呼び出しと等価である。
82 .in +4n
83 .nf
84
85 int c, s;
86 s = getcpu(&c, NULL, NULL);
87 cpu = (s == \-1) ? s : c;
88 .fi
89 .in
90 .SH 関連項目
91 \fBgetcpu\fP(2)
92 .SH この文書について
93 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
94 である。プロジェクトの説明とバグ報告に関する情報は
95 http://www.kernel.org/doc/man\-pages/ に書かれている。