OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[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)