.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk .\" .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 .\" .TH SCHED_GETCPU 3 2010-10-31 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O sched_getcpu \- determine CPU on which the calling thread is running sched_getcpu \- 呼び出したスレッドが実行されている CPU を知る .\"O .SH SYNOPSIS .SH 書式 .nf .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" .\" Really:_BSD_SOURCE || _SVID_SOURCE .B #include .B int sched_getcpu(void); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O .BR sched_getcpu () .\"O returns the number of the CPU on which the calling thread is currently executing. .BR sched_getcpu () は、呼び出したスレッドが現在実行されている CPU の番号を返す。 .\"O .SH RETURN VALUE .SH 返り値 .\"O On success, .\"O .BR sched_getcpu () .\"O returns a nonnegative CPU number. .\"O On error, \-1 is returned and .\"O .I errno .\"O is set to indicate the error. 成功すると、 .BR sched_getcpu () は非負の CPU 番号を返す。 エラーの場合、\-1 を返し、 .I errno にエラーを示す値を設定する。 .\"O .SH ERRORS .SH エラー .TP .B ENOSYS .\"O This kernel does not implement .\"O .BR getcpu (2). このカーネルでは .BR getcpu (2) が実装されていない。 .\"O .SH VERSIONS .SH バージョン .\"O This function is available since glibc 2.6. この関数は glibc 2.6 以降で利用可能である。 .\"O .SH CONFORMING TO .SH 準拠 .\"O .BR sched_getcpu () .\"O is glibc specific. .BR sched_getcpu () は glibc 固有である。 .\"O .SH NOTES .SH 注意 .\"O The call .in +4n .nf cpu = sched_getcpu(); .fi .in .\"O is equivalent to the following .\"O .BR getcpu (2) .\"O call: は、以下の .BR getcpu (2) の呼び出しと等価である。 .in +4n .nf int c, s; s = getcpu(&c, NULL, NULL); cpu = (s == -1) ? s : c; .fi .in .\"O .SH SEE ALSO .SH 関連項目 .BR getcpu (2)