Use _SC_NPROCESSORS_CONF instead of _SC_NPROCESSORS_ONLN

This commit is contained in:
pooler 2012-06-02 14:53:54 +02:00
parent 21cba02b78
commit 003d1f1f84

View file

@ -998,8 +998,8 @@ int main(int argc, char *argv[])
SYSTEM_INFO sysinfo; SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo); GetSystemInfo(&sysinfo);
num_processors = sysinfo.dwNumberOfProcessors; num_processors = sysinfo.dwNumberOfProcessors;
#elif defined(_SC_NPROCESSORS_ONLN) #elif defined(_SC_NPROCESSORS_CONF)
num_processors = sysconf(_SC_NPROCESSORS_ONLN); num_processors = sysconf(_SC_NPROCESSORS_CONF);
#elif defined(HW_NCPU) #elif defined(HW_NCPU)
int req[] = { CTL_HW, HW_NCPU }; int req[] = { CTL_HW, HW_NCPU };
size_t len = sizeof(num_processors); size_t len = sizeof(num_processors);