Section: Linux Programmer's Manual (3) Updated: 2009-12-08 Local index
sched_getcpu - determine CPU on which the calling thread is running
Feature Test Macro Requirements for glibc (see
_BSD_SOURCE || _SVID_SOURCE
returns the number of the CPU on which the calling thread is currently executing.
returns a nonnegative CPU number.
On error, -1 is returned and
is set to indicate the error.
This kernel does not implement
This function is available since glibc 2.6.
is glibc specific.
cpu = sched_getcpu();
is equivalent to the following
int c, s;
s = getcpu(&c, NULL, NULL);
cpu = (s == -1) ? s : c;
This page is part of release 3.27 of the Linux
A description of the project,
and information about reporting bugs,
can be found at
- RETURN VALUE
- CONFORMING TO
- SEE ALSO
This document was created by
using the manual pages.
Time: 21:54:26 GMT, April 16, 2011