OSDN Git Service

Import translated manuals from JM CVS Repository.
[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 .\" 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 2009-12-08 "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 .B #define _GNU_SOURCE
37 .B #include <sched.h>
38
39 .B int sched_getcpu(void);
40 .fi
41 .sp
42 .in -4n
43 .\"O Feature Test Macro Requirements for glibc (see
44 .\"O .BR feature_test_macros (7)):
45 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
46 .RB ( feature_test_macros (7)
47 »²¾È):
48 .in
49 .sp
50 .BR sched_getcpu ():
51 _BSD_SOURCE || _SVID_SOURCE
52 .\"O .SH DESCRIPTION
53 .SH ÀâÌÀ
54 .\"O .BR sched_getcpu ()
55 .\"O returns the number of the CPU on which the calling thread is currently executing.
56 .BR sched_getcpu ()
57 ¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¸½ºß¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë CPU ¤ÎÈÖ¹æ¤òÊÖ¤¹¡£
58 .\"O .SH RETURN VALUE
59 .SH ÊÖ¤êÃÍ
60 .\"O On success,
61 .\"O .BR sched_getcpu ()
62 .\"O returns a nonnegative CPU number.
63 .\"O On error, \-1 is returned and
64 .\"O .I errno
65 .\"O is set to indicate the error.
66 À®¸ù¤¹¤ë¤È¡¢
67 .BR sched_getcpu ()
68 ¤ÏÈóÉé¤Î CPU ÈÖ¹æ¤òÊÖ¤¹¡£
69 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
70 .I errno
71 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
72 .\"O .SH ERRORS
73 .SH ¥¨¥é¡¼
74 .TP
75 .B ENOSYS
76 .\"O This kernel does not implement
77 .\"O .BR getcpu (2).
78 ¤³¤Î¥«¡¼¥Í¥ë¤Ç¤Ï
79 .BR getcpu (2)
80 ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
81 .\"O .SH VERSIONS
82 .SH ¥Ð¡¼¥¸¥ç¥ó
83 .\"O This function is available since glibc 2.6.
84 ¤³¤Î´Ø¿ô¤Ï glibc 2.6 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
85 .\"O .SH CONFORMING TO
86 .SH ½àµò
87 .\"O .BR sched_getcpu ()
88 .\"O is glibc specific.
89 .BR sched_getcpu ()
90 ¤Ï glibc ¸ÇÍ­¤Ç¤¢¤ë¡£
91 .\"O .SH NOTES
92 .SH Ãí°Õ
93 .\"O The call
94 .in +4n
95 .nf
96
97 cpu = sched_getcpu();
98
99 .fi
100 .in
101 .\"O is equivalent to the following
102 .\"O .BR getcpu (2)
103 .\"O call:
104 ¤Ï¡¢°Ê²¼¤Î
105 .BR getcpu (2)
106 ¤Î¸Æ¤Ó½Ð¤·¤ÈÅù²Á¤Ç¤¢¤ë¡£
107 .in +4n
108 .nf
109
110 int c, s;
111 s = getcpu(&c, NULL, NULL);
112 cpu = (s == -1) ? s : c;
113 .fi
114 .in
115 .\"O .SH SEE ALSO
116 .SH ´ØÏ¢¹àÌÜ
117 .BR getcpu (2)