getcpu(2) System Calls Manual getcpu(2) getcpu - NUMA (libc -lc) #define _GNU_SOURCE /* feature_test_macros(7) */ #include int getcpu(unsigned int *_Nullable cpu, unsigned int *_Nullable node); getcpu() cpu node. . NUMA. cpu node NULL . cpu : sched_setaffinity(2) . ( .) cpu node . 0. -1 errno . EFAULT . . 2.6.19 (x86-64 i386) glibc 2.29. C : int getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *tcache); tcache 2.6.24 ( ) NULL 2.6.23 . 2.6.23 tcache NULL getcpu(). getcpu() . . . ( vdso(7).) getcpu() NUMA. mbind(2), sched_setaffinity(2), set_mempolicy(2), sched_getcpu(3), cpuset(7), vdso(7) 3 . . : . 6.18 8 2026 getcpu(2)