OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / sched_getcpu.3
1 .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\"*******************************************************************
25 .\"
26 .\" This file was generated with po4a. Translate the source file.
27 .\"
28 .\"*******************************************************************
29 .TH SCHED_GETCPU 3 2010\-10\-31 Linux "Linux Programmer's Manual"
30 .SH 名前
31 sched_getcpu \- 呼び出したスレッドが実行されている CPU を知る
32 .SH 書式
33 .nf
34 .\" Really:_BSD_SOURCE || _SVID_SOURCE
35 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
36 \fB#include <sched.h>\fP
37
38 \fBint sched_getcpu(void);\fP
39 .fi
40 .SH 説明
41 \fBsched_getcpu\fP()  は、呼び出したスレッドが現在実行されている CPU の番号を返す。
42 .SH 返り値
43 成功すると、 \fBsched_getcpu\fP()  は非負の CPU 番号を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP
44 にエラーを示す値を設定する。
45 .SH エラー
46 .TP 
47 \fBENOSYS\fP
48 このカーネルでは \fBgetcpu\fP(2)  が実装されていない。
49 .SH バージョン
50 この関数は glibc 2.6 以降で利用可能である。
51 .SH 準拠
52 \fBsched_getcpu\fP()  は glibc 固有である。
53 .SH 注意
54 呼び出し
55 .in +4n
56 .nf
57
58 cpu = sched_getcpu();
59
60 .fi
61 .in
62 は、以下の \fBgetcpu\fP(2)  呼び出しと等価である。
63 .in +4n
64 .nf
65
66 int c, s;
67 s = getcpu(&c, NULL, NULL);
68 cpu = (s == \-1) ? s : c;
69 .fi
70 .in
71 .SH 関連項目
72 \fBgetcpu\fP(2)