OSDN Git Service

ef76c9007a70f2c9347525cb1906d906573eeeb8
[linuxjm/jm.git] / manual / LDP_man-pages / 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 .\"
32 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
33 .\"         all rights reserved.
34 .\" Translated 2008-08-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.04
35 .\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
36 .\"
37 .TH SCHED_GETCPU 3 2017\-09\-15 Linux "Linux Programmer's Manual"
38 .SH 名前
39 sched_getcpu \- 呼び出したスレッドが実行されている CPU を知る
40 .SH 書式
41 .nf
42 \fB#include <sched.h>\fP
43 .PP
44 \fBint sched_getcpu(void);\fP
45 .fi
46 .PP
47 .RS -4
48 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
49 .RE
50 .PP
51 \fBsched_getcpu\fP():
52 .ad l
53 .RS 4
54 .PD 0
55 .TP  4
56 glibc 2.14 以降:
57 _GNU_SOURCE
58 .TP  4
59 glibc 2.14 より前:
60 _BSD_SOURCE || _SVID_SOURCE
61     /* _GNU_SOURCE も定義される */
62 .PD
63 .RE
64 .ad b
65 .SH 説明
66 \fBsched_getcpu\fP()  は、呼び出したスレッドが現在実行されている CPU の番号を返す。
67 .SH 返り値
68 成功すると、 \fBsched_getcpu\fP()  は非負の CPU 番号を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP
69 にエラーを示す値を設定する。
70 .SH エラー
71 .TP 
72 \fBENOSYS\fP
73 このカーネルでは \fBgetcpu\fP(2)  が実装されていない。
74 .SH バージョン
75 この関数は glibc 2.6 以降で利用可能である。
76 .SH 属性
77 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
78 .TS
79 allbox;
80 lb lb lb
81 l l l.
82 インターフェース        属性  値
83 T{
84 \fBsched_getcpu\fP()
85 T}      Thread safety   MT\-Safe
86 .TE
87 .SH 準拠
88 \fBsched_getcpu\fP()  は glibc 固有である。
89 .SH 注意
90 呼び出し
91 .PP
92 .in +4n
93 .EX
94 cpu = sched_getcpu();
95 .EE
96 .in
97 .PP
98 は、以下の \fBgetcpu\fP(2)  呼び出しと等価である。
99 .PP
100 .in +4n
101 .EX
102 int c, s;
103 s = getcpu(&c, NULL, NULL);
104 cpu = (s == \-1) ? s : c;
105 .EE
106 .in
107 .SH 関連項目
108 \fBgetcpu\fP(2), \fBsched\fP(7)
109 .SH この文書について
110 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
111 \%https://www.kernel.org/doc/man\-pages/ に書かれている。