1 .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
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
28 .TH SCHED_GETCPU 3 2010-10-31 "Linux" "Linux Programmer's Manual"
31 .\"O sched_getcpu \- determine CPU on which the calling thread is running
32 sched_getcpu \- ¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë CPU ¤òÃΤë
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
41 .B int sched_getcpu(void);
45 .\"O .BR sched_getcpu ()
46 .\"O returns the number of the CPU on which the calling thread is currently executing.
48 ¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬¸½ºß¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë CPU ¤ÎÈÖ¹æ¤òÊÖ¤¹¡£
52 .\"O .BR sched_getcpu ()
53 .\"O returns a nonnegative CPU number.
54 .\"O On error, \-1 is returned and
56 .\"O is set to indicate the error.
59 ¤ÏÈóÉé¤Î CPU ÈÖ¹æ¤òÊÖ¤¹¡£
60 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
62 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
67 .\"O This kernel does not implement
74 .\"O This function is available since glibc 2.6.
75 ¤³¤Î´Ø¿ô¤Ï glibc 2.6 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
76 .\"O .SH CONFORMING TO
78 .\"O .BR sched_getcpu ()
79 .\"O is glibc specific.
92 .\"O is equivalent to the following
97 ¤Î¸Æ¤Ó½Ð¤·¤ÈÅù²Á¤Ç¤¢¤ë¡£
102 s = getcpu(&c, NULL, NULL);
103 cpu = (s == \-1) ? s : c;