Better check for Rosetta 2

This uses the syctl.proc_translated sysctl, which is the Apple
documented way to check for Rosetta 2 environment.
This commit is contained in:
Felix Bünemann 2020-11-22 00:43:03 +01:00
parent 5510ae7ccd
commit f16163c144

View File

@ -69,7 +69,7 @@ module Hardware
# conflict between what `uname` reports and the underlying `sysctl` flags, # conflict between what `uname` reports and the underlying `sysctl` flags,
# since the `sysctl` flags don't change behaviour under Rosetta 2. # since the `sysctl` flags don't change behaviour under Rosetta 2.
def in_rosetta2? def in_rosetta2?
intel? && physical_cpu_arm64? sysctl_bool("sysctl.proc_translated")
end end
def features def features