MCPcopy Create free account
hub / github.com/Kitware/CMake / QueryProcessorBySysconf

Method QueryProcessorBySysconf

Source/kwsys/SystemInformation.cxx:3640–3660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3638}
3639
3640bool SystemInformationImplementation::QueryProcessorBySysconf()
3641{
3642#if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
3643// IRIX names this slightly different
3644# define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
3645#endif
3646
3647#ifdef _SC_NPROCESSORS_ONLN
3648 long c = sysconf(_SC_NPROCESSORS_ONLN);
3649 if (c <= 0) {
3650 return false;
3651 }
3652
3653 this->NumberOfPhysicalCPU = static_cast<unsigned int>(c);
3654 this->NumberOfLogicalCPU = this->NumberOfPhysicalCPU;
3655
3656 return true;
3657#else
3658 return false;
3659#endif
3660}
3661
3662bool SystemInformationImplementation::QueryProcessor()
3663{

Callers 2

QueryProcessorMethod · 0.95
QuerySolarisProcessorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected