Use _SC_NPROCESSORS_CONF instead of _SC_NPROCESSORS_ONLN
This commit is contained in:
parent
21cba02b78
commit
003d1f1f84
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue