nproc.c (131B)
1 2 3 4 5 6 7 8 9 10
#include <stdio.h> #include <sys/sysinfo.h> int main(void) { int cores = get_nprocs_conf(); printf("%i\n", cores); return 0; }