sched_getcpu3
Get current cpu
Usage
#include <sched.h>
int
sched_getcpu(void);
Library
Standard C Library (libc, -lc)
Overview
The sched_getcpu() function returns the current CPU on which the calling thread is running.
Return values
sched_getcpu() returns the 0-based index of the current CPU at the time of the call. The value may become invalid immediately after return, unless the thread is pinned to a specific CPU. CPU numbering is the same as used by cpuset(2) and CPU affinity calls.
There are no error values as sched_getcpu() does not fail.
Releases
Unchanged in 6 releases since FreeBSD 14.3-RELEASE.