#include "unistd.h" printf("system cpu num is %d\n", sysconf( _SC_NPROCESSORS_CONF)); printf("system enable cpu num is %d\n", sysconf(_SC_NPROCESSORS_ONLN));