Detect if running under Rosetta
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Utilities {
|
||||
|
||||
qint32 GetMacOsVersion();
|
||||
void IncreaseFDLimit();
|
||||
bool ProcessTranslated();
|
||||
|
||||
} // namespace Utilities
|
||||
|
||||
|
||||
@@ -59,4 +59,16 @@ void IncreaseFDLimit() {
|
||||
|
||||
}
|
||||
|
||||
bool ProcessTranslated() {
|
||||
|
||||
int value = 0;
|
||||
size_t value_size = sizeof(value);
|
||||
if (sysctlbyname("sysctl.proc_translated", &value, &value_size, nullptr, 0) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return value == 1;
|
||||
|
||||
}
|
||||
|
||||
} // namespace Utilities
|
||||
|
||||
Reference in New Issue
Block a user