如Delan所提到的,/proc/cpuinfo提供了这些详细信息。还有sysconf可用于获取逻辑CPU数量。long numcpus = sysconf(_SC_NPROCESSORS_ONLN); printf("Number of CPU's=%ld\n",numcpus);