Commit Graph

6 Commits

Author SHA1 Message Date
Deadbeef
7a79454de4 update internal send_signal comment 2025-06-27 18:24:42 +08:00
Jeremy Smart
b3914945ae add ChildExt(::send_signal) 2025-06-18 00:38:55 -04:00
Josh Triplett
a3cf6f6408 Add std::os::unix::process::CommandExt::chroot to safely chroot a child process
This adds a `chroot` method to the `CommandExt` extension trait for the
`Command` builder, to set a directory to chroot into. This will chroot
the child process into that directory right before calling chdir for the
`Command`'s working directory.

To avoid allowing a process to have a working directory outside of the
chroot, if the `Command` does not yet have a working directory set,
`chroot` will set its working directory to "/".
2025-05-20 18:25:05 +02:00
joboet
5f145689b1 std: get rid of sys_common::process
Move the public `CommandEnvs` into the `process` module (and make it a wrapper type for an internal iterator type) and everything else into `sys::process` as per #117276.
2025-04-28 11:13:50 +02:00
Thalia Archibald
90fe2805df Move sys::pal::os::Env into sys::env
Although `Env` (as `Vars`), `Args`, path functions, and OS constants are
publicly exposed via `std::env`, their implementations are each
self-contained. Keep them separate in `std::sys` and make a new module,
`sys::env`, for `Env`.
2025-04-21 20:56:43 -07:00
joboet
89f85cbfa7 std: move process implementations to sys
As per #117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
2025-03-22 12:42:34 +01:00