Skip to content

Tracking Issue for process_setsid #105376

Open

Description

@HarveyHunt

Feature gate: #![feature(process_setsid)]

This is a tracking issue for adding a setsid method to the std::os::unix::process::CommandExt trait.

Add a new setsid method to the CommandExt trait for UNIX systems. Using the setsid method, a caller can create a new session and process group whilst still benefiting from the POSIX spawn fast path code.

Public API

trait CommandExt {
    fn setsid(&mut self) -> &mut Command
}

Steps / History

Unresolved Questions

  • Naming is inconsistent; the setpgid equivalent is called process_group, but this just has the C name.
  • Missing documentation
  • Missing tests

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    C-tracking-issue
    T-libs-api
    on Dec 6, 2022
  2. added
    A-process
    on Jul 22, 2023
  3. workingjubilee commented on Jul 10, 2025

    @workingjubilee
    Member

    It appears POSIX_SPAWN_SETSID is not actually defined in our libc crate anywhere except Linux.

  4. added a commit that references this issue on Jul 10, 2025
  5. LevitatingBusinessMan commented on Jul 11, 2025

    @LevitatingBusinessMan
    Contributor

    It appears POSIX_SPAWN_SETSID is not actually defined in our libc crate anywhere except Linux.

    Technically, I think it's also defined for Solaris, Illumos, Hurd and Haiku. But our standard library does not support using posix_spawn for those platforms, with the exception of illumos.

  6. added a commit that references this issue on Jul 11, 2025
  7. added a commit that references this issue on Jul 12, 2025
  8. workingjubilee commented on Jul 13, 2025

    @workingjubilee
    Member

    Huh. That's Even Weirder honestly.

  9. added a commit that references this issue on Jul 21, 2025
  10. added
    T-libs
    and removed
    T-libs-api
    on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-processC-tracking-issueT-libs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions