Expand description
Unix-only helpers shared by the host CLI and the guest daemon. Unix-only process helpers both the host CLI and the guest daemon need.
Small, dependency-light implementations shared so each of them exists
exactly once: the built-in guest cannot be rebuilt for users, but its
behaviour tracks the host whenever the helpers agree. Keep this module
free of podbox types — it only touches the standard library plus the
nix/rustix/signal-hook shims, so the wire-pure core of the crate
stays usable from wasm targets (this module is compiled out there).
Functions§
- install_
shutdown_ signal_ handler - Register SIGTERM/SIGINT handlers that set the returned flag.
- open_
pidfd - Open a pidfd for
pid(Linux 5.3+). - send_
bytes_ with_ fds - Send
dataon a Unix stream with file descriptors attached, so the receiver reads both in one message. - wait_
child_ timeout - Wait for
child, SIGKILLing it oncetimeouthas elapsed. - xdg_
runtime_ dir $XDG_RUNTIME_DIR, or the fallback every caller re-derived by hand: the uid’s systemd user-runtime directory. Matches how systemd populates the variable for user sessions, so the fallback only ever fires outside one.