How to get the number of CPUs in Linux using C? May 23, 2023 by Tarik #include <unistd.h> long number_of_processors = sysconf(_SC_NPROCESSORS_ONLN);