Detect if the current process is running as a translated binary under
[Rosetta
].
toml
[dependencies]
is_proc_translated = "0.1"
```rust use std::process::Command;
use isproctranslated::isproctranslated;
fn main() { // Force executing the arm64 slice of a Universal Binary. let status = if isproctranslated() { Command::new("arch") .arg("-arm64") .arg("buck") .arg("build") .status() .expect("failed to execute process") } else { Command::new("buck") .arg("build") .status() .expect("failed to execute process") };
println!("process finished with: {status}");
} ```
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.