Expand description
Deadline- and allocation-bounded subprocess execution.
Privileged components use small command-line clients at a few platform boundaries; this wrapper keeps a wedged client, a compromised daemon or an inherited pipe in a descendant from pinning or exhausting its caller.
Modules§
- command
- The
Commandhelpers domains share:which,runand bounded capture with one error vocabulary. Native only: the page’s build links this crate through the UI’s speech engine, and a browser page has no subprocesses to look up or start. TheCommandhelpers Tilo’s domains share: bounded subprocess execution, so every shell-out shares one error vocabulary (missing binary, non-zero exit, spawn failure) and hands it straight totracing::warn!.
Structs§
- Async
Command - A nonblocking bounded command which cancels its process group when dropped.
- Output
- WakeFd
- A level-triggered wake descriptor: readable from the first
ringuntildrain. A supervisor passesfdtowait_child_or; any thread rings it after changing what the supervisor must re-check.
Enums§
- Error
- Stderr
Observation - An informational copy of bytes the owned stderr capture already read. Capture stays authoritative; overflow disables only this queue.
- Wakeup
Constants§
- MAX_
INPUT_ BYTES - Maximum secret or request body this wrapper accepts.
- STDERR_
OBSERVATION_ CHUNKS
Functions§
- kill_
tree - Kill a child started with
own_process_treetogether with its descendants, and the child itself as a fallback. The caller still reaps it. - make_
executable - Mark a script or program file executable for everyone and writable only
by its owner (mode
0755on Unix). A no-op where executability is not a file permission. - own_
process_ tree - Start
command’s child as the leader of its own process tree, sokill_treealso reaches every descendant it starts. On Unix this is a new process group named after the child’s pid. - run
- Run one fixed program/argv transaction with bounded input, output, and time.
- run_os
- run_
prepared - Run a caller-prepared command, replacing its standard streams and process-group configuration with the bounded policy.
- run_
prepared_ with_ input_ limit - Run a prepared command with caller-selected input and stream ceilings, for
bounded bulk payloads such as print documents. Most callers want
run_prepared. - run_
prepared_ with_ limits - Run a caller-prepared command with independent output-stream ceilings, for helpers whose primary output is legitimately much larger than their diagnostics, such as image acquisition tools.
- run_
prepared_ with_ stdin - Run a prepared command reading
fileas its standard input: a handle the caller holds (a file the person chose) given to the program as it is, rather than a path it would open itself. - run_
with_ env - spawn_
prepared - Spawn a caller-prepared bounded command for nonblocking polling. Dropping the handle cancels and reaps the process group.
- spawn_
prepared_ observing_ stderr - Spawn with a bounded nonblocking copy of the owned stderr capture.
- terminate_
tree - Stop a child started with
own_process_treeand reap it. With a non-zerograce, the tree is first asked to exit (SIGTERMon Unix) and gets that long to do so: until the child and, on Unix, every process left in its group are gone. Whatever remains is then killed withkill_tree. - wait_
child_ or - Wait until
childexits,wakebecomes readable, ordeadlinepasses, without polling. With neither a wake descriptor nor a deadline this blocks until the child exits; a deadline already in the past only probes. - wait_
or_ kill wait_timeout, then kill and reap a child still running at the deadline.Nonewhen it had to be killed.- wait_
timeout - Wait up to
timeoutforchildto exit, and reap it.Nonewhen it is still running at the deadline; it is left running. On Unix this sleeps inwait_child_orrather than polling. - without_
console_ window - Start
command’s child without a console window of its own. On Windows a console program otherwise opens one; elsewhere this changes nothing.