I’m looking to differentiate between Core Solo/Duo and Core 2 Duo processors for 64-bit support.
On a Core 2 Duo, then `sysctl hw.cpu64bit_capable` gives 1, as desired, but on a 32-bit processor, it throws an error, saying:
second level name cpu64bit_capable in hw.cpu64bit_capable is invalid
What’s the best way to detect a 64-bit processor?
Thanks.
You can still use your
sysctlcommand by looking at the command’s return value.On 32 bit CPU it should return
false.Alternatively, depending what you’re really looking for, you can test for 64 bit EFI with
ioreg, though I think your CPU could still be 64 bit with a 32 bit EFI.On a 64 bit EFI machine, you’d get this:
On a machine lacking 64 bit EFI, you’d get
false.