Closed
Description
I tried this code:
use std::process::Command;
let mut cmd = Command::new("ls");
cmd.current_dir(".");
cmd.output().unwrap();
(compiled under x86_64-unknown-linux-musl)
I expected to see this happen:
The posix_spawn
fast path is used.
Instead, this happened:
Rust fell back to the fork/exec slow path. (Inspected this using gdb and strace).
This is presumably because
rust/library/std/src/sys/unix/process/process_unix.rs
Lines 442 to 447 in 6dbae3a
Meta
rustc --version --verbose
:
rustc 1.64.0-nightly (93ffde6f0 2022-07-23)
binary: rustc
commit-hash: 93ffde6f04d3d24327a4e17a2a2bf4f63c246235
commit-date: 2022-07-23
host: x86_64-unknown-linux-gnu
release: 1.64.0-nightly
LLVM version: 14.0.6
Backtrace
<backtrace>