OSDN Git Service

ded7405b17f4c9c25526e4ca4071ae915507a407
[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 .\" 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 .\"O .SH NAME
30 .SH 名前
31 .\"O sched_getcpu \- determine CPU on which the calling thread is running
32 sched_getcpu \- 呼び出したスレッドが実行されている CPU を知る
33 .\"O .SH SYNOPSIS
34 .SH 書式
35 .nf
36 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
37 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) 参照 */"
38 .\" Really:_BSD_SOURCE || _SVID_SOURCE
39 .B #include <sched.h>
40
41 .B int sched_getcpu(void);
42 .fi
43 .\"O .SH DESCRIPTION
44 .SH 説明
45 .\"O .BR sched_getcpu ()
46 .\"O returns the number of the CPU on which the calling thread is currently executing.
47 .BR sched_getcpu ()
48 は、呼び出したスレッドが現在実行されている CPU の番号を返す。
49 .\"O .SH RETURN VALUE
50 .SH 返り値
51 .\"O On success,
52 .\"O .BR sched_getcpu ()
53 .\"O returns a nonnegative CPU number.
54 .\"O On error, \-1 is returned and
55 .\"O .I errno
56 .\"O is set to indicate the error.
57 成功すると、
58 .BR sched_getcpu ()
59 は非負の CPU 番号を返す。
60 エラーの場合、\-1 を返し、
61 .I errno
62 にエラーを示す値を設定する。
63 .\"O .SH ERRORS
64 .SH エラー
65 .TP
66 .B ENOSYS
67 .\"O This kernel does not implement
68 .\"O .BR getcpu (2).
69 このカーネルでは
70 .BR getcpu (2)
71 が実装されていない。
72 .\"O .SH VERSIONS
73 .SH バージョン
74 .\"O This function is available since glibc 2.6.
75 この関数は glibc 2.6 以降で利用可能である。
76 .\"O .SH CONFORMING TO
77 .SH 準拠
78 .\"O .BR sched_getcpu ()
79 .\"O is glibc specific.
80 .BR sched_getcpu ()
81 は glibc 固有である。
82 .\"O .SH NOTES
83 .SH 注意
84 .\"O The call
85 .in +4n
86 .nf
87
88 cpu = sched_getcpu();
89
90 .fi
91 .in
92 .\"O is equivalent to the following
93 .\"O .BR getcpu (2)
94 .\"O call:
95 は、以下の
96 .BR getcpu (2)
97 の呼び出しと等価である。
98 .in +4n
99 .nf
100
101 int c, s;
102 s = getcpu(&c, NULL, NULL);
103 cpu = (s == \-1) ? s : c;
104 .fi
105 .in
106 .\"O .SH SEE ALSO
107 .SH 関連項目
108 .BR getcpu (2)