How to get the number of CPUs in Linux using C?

#include <unistd.h>
long number_of_processors = sysconf(_SC_NPROCESSORS_ONLN);

Leave a Comment