English pages are provided only to compare translations to original pages,
better looking pages can be browsed
at the Linux man-pages official site.
Linux Programmer's Manual (3)
sched_getcpu - determine CPU on which the calling thread is running
Feature Test Macro Requirements for glibc (see
- Since glibc 2.14:
- Before glibc 2.14:
_BSD_SOURCE || _SVID_SOURCE
/* _GNU_SOURCE also suffices */
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.
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.66 of the Linux
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
- RETURN VALUE
- CONFORMING TO
- SEE ALSO
This document was created by
using the manual pages.
Time: 21:43:02 GMT, July 12, 2014