Skip to content

[Feature request] Pass file descriptors in std::comand::Command #144191

@axelkar

Description

@axelkar

I was reading bytecodealliance/rustix#100 (comment) and remembered that Rust's std doesn't have a way to pass (non-stdio) file descriptors to child processes.

I was wondering, could a way to do that be added into std::command::Command?

I also propose these properties:

  • Know the FD numbers before spawning, e.g. for the LISTEN_FDS environment variable. Maybe the user provides the FD numbers and the library uses dup2?
  • close_fds=True (is this applicable? not sure how it's implemented in Python)

Prior work:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-processArea: `std::process` and `std::env`C-discussionCategory: Discussion or questions that doesn't represent real issues.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions