Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use posix_spawn on musl targets #77432

Merged
merged 1 commit into from
Oct 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions library/std/src/sys/unix/process/process_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ impl Command {
#[cfg(not(any(
target_os = "macos",
target_os = "freebsd",
all(target_os = "linux", target_env = "gnu")
all(target_os = "linux", target_env = "gnu"),
all(target_os = "linux", target_env = "musl"),
cuviper marked this conversation as resolved.
Show resolved Hide resolved
)))]
fn posix_spawn(
&mut self,
Expand All @@ -267,7 +268,8 @@ impl Command {
#[cfg(any(
target_os = "macos",
target_os = "freebsd",
all(target_os = "linux", target_env = "gnu")
all(target_os = "linux", target_env = "gnu"),
all(target_os = "linux", target_env = "musl"),
))]
fn posix_spawn(
&mut self,
Expand Down Expand Up @@ -297,10 +299,10 @@ impl Command {
}
}

// Solaris and glibc 2.29+ can set a new working directory, and maybe
// others will gain this non-POSIX function too. We'll check for this
// weak symbol as soon as it's needed, so we can return early otherwise
// to do a manual chdir before exec.
// Solaris, glibc 2.29+, and musl 1.24+ can set a new working directory,
// and maybe others will gain this non-POSIX function too. We'll check
// for this weak symbol as soon as it's needed, so we can return early
// otherwise to do a manual chdir before exec.
weak! {
fn posix_spawn_file_actions_addchdir_np(
*mut libc::posix_spawn_file_actions_t,
Expand Down