OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[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 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
25 .\"         all rights reserved.
26 .\" Translated 2008-08-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.04
27 .\" 
28 .TH SCHED_GETCPU 3 2010-10-31 "Linux" "Linux Programmer's Manual"
29 .SH 名前
30 sched_getcpu \- 呼び出したスレッドが実行されている CPU を知る
31 .SH 書式
32 .nf
33 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) 参照 */"
34 .\" Really:_BSD_SOURCE || _SVID_SOURCE
35 .B #include <sched.h>
36
37 .B int sched_getcpu(void);
38 .fi
39 .SH 説明
40 .BR sched_getcpu ()
41 は、呼び出したスレッドが現在実行されている CPU の番号を返す。
42 .SH 返り値
43 成功すると、
44 .BR sched_getcpu ()
45 は非負の CPU 番号を返す。
46 エラーの場合、\-1 を返し、
47 .I errno
48 にエラーを示す値を設定する。
49 .SH エラー
50 .TP
51 .B ENOSYS
52 このカーネルでは
53 .BR getcpu (2)
54 が実装されていない。
55 .SH バージョン
56 この関数は glibc 2.6 以降で利用可能である。
57 .SH 準拠
58 .BR sched_getcpu ()
59 は glibc 固有である。
60 .SH 注意
61 .in +4n
62 .nf
63
64 cpu = sched_getcpu();
65
66 .fi
67 .in
68 は、以下の
69 .BR getcpu (2)
70 の呼び出しと等価である。
71 .in +4n
72 .nf
73
74 int c, s;
75 s = getcpu(&c, NULL, NULL);
76 cpu = (s == \-1) ? s : c;
77 .fi
78 .in
79 .SH 関連項目
80 .BR getcpu (2)