Skip to content

rust: library: Add setsid method to CommandExt trait #142391

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LevitatingBusinessMan
Copy link

@LevitatingBusinessMan LevitatingBusinessMan commented Jun 12, 2025

Add a setsid method to the CommandExt trait so that callers can create a process in a new session and process group whilst still using the POSIX spawn fast path.

Tracking issue: #105376

ACP: rust-lang/libs-team#184

This PR was previously submitted by @HarveyHunt (whom I marked as Co-Author in the commit message) in #105377. However that PR went stale.

I applied the suggestion to change the function signature to fn setsid(&mut self, setsid: bool) -> &mut Command.

@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2025

r? @workingjubilee

rustbot has assigned @workingjubilee.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 12, 2025
@rustbot

This comment has been minimized.

@LevitatingBusinessMan
Copy link
Author

@rustbot label +T-libs-api -T-libs

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 12, 2025
@rust-log-analyzer

This comment has been minimized.

Add a setsid method to the CommandExt trait so that callers can create
a process in a new session and process group whilst still using the
POSIX spawn fast path.

Tracking issue: rust-lang#105376

Co-Authored-By: Harvey Hunt <harveyhunt@fb.com>
@rustbot
Copy link
Collaborator

rustbot commented Jun 13, 2025

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] object test:false 10.734
error[E0425]: cannot find value `POSIX_SPAWN_SETSID` in crate `libc`
    --> library/std/src/sys/process/unix/unix.rs:750:32
     |
750  |                 flags |= libc::POSIX_SPAWN_SETSID;
     |                                ^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `POSIX_SPAWN_SETSIGDEF`
     |
    ::: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.172/src/unix/bsd/apple/mod.rs:5232:1
     |
5232 | pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x0004;
     | -------------------------------------- similarly named constant `POSIX_SPAWN_SETSIGDEF` defined here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants