| 3638 | } |
| 3639 | |
| 3640 | bool 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 | |
| 3662 | bool SystemInformationImplementation::QueryProcessor() |
| 3663 | { |
no outgoing calls
no test coverage detected