2 ms·
IIRC this utility is a wrapper around glibc get_nprocs(), which on Linux will ultimately read from /sys/devices/system/cpu/online. If you need this information
by cycloptic 6y ago
IIRC this utility is a wrapper around glibc get_nprocs(), which on Linux will ultimately read from /sys/devices/system/cpu/online. If you need this information from a compiled language, you should probably use the glibc wrapper.
- rwmj 6y agoWe usually use np = sysconf(_SC_NPROCESSORS_ONLN); However I'm interested in whether this is cgroups- (hence container-) aware or not. I'm not actually sure, and it will affect some of my software when running in a container.