sysctl name "hw.ncpu" (HW_NCPU) is deprecated in Mac OS X
According to the OS X man page for sysctl(https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/sysctlbyname.3.html), HW_NCPU used by the current implementation of getNumberOfProcessors() is deprecated.
Instead, Mac OS X provides the following 4 options:
- hw.physicalcpu: The number of physical processors available in the current power management mode.
- hw.physicalcpu_max: The maximum number of physical processors that could be available this boot.
- hw.logicalcpu: The number of logical processors available in the current power management mode.
- hw.logicalcpu_max: The maximum number of logical processors that could be available this boot.
I am not sure which one fits best to GHC runtime. Any idea? sysconf implementation of getNumberOfProcessors() seems to prefer _SC_NPROCESSORS_ONLN to _SC_NPROCESSORS_CONF when both are defined.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.6.3 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | simonmar |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"sysctl name \"hw.ncpu\" (HW_NCPU) is deprecated in Mac OS X","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"simonmar"},"version":"7.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["simonmar"],"type":"Task","description":"According to the OS X man page for sysctl(https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/sysctlbyname.3.html), HW_NCPU used by the current implementation of getNumberOfProcessors() is deprecated.\r\n\r\nInstead, Mac OS X provides the following 4 options:\r\n* hw.physicalcpu: The number of physical processors available in the current power management mode.\r\n* hw.physicalcpu_max: The maximum number of physical processors that could be available this boot.\r\n* hw.logicalcpu: The number of logical processors available in the current power management mode.\r\n* hw.logicalcpu_max: The maximum number of logical processors that could be available this boot.\r\n\r\nI am not sure which one fits best to GHC runtime. Any idea? sysconf implementation of getNumberOfProcessors() seems to prefer _SC_NPROCESSORS_ONLN to _SC_NPROCESSORS_CONF when both are defined.","type_of_failure":"OtherFailure","blocking":[]} -->
issue