std::process¶
Canonical process control and child-process API; std::os::exec is compatibility-only.
API details and source¶
The implementation source contains the complete declarations and implementation notes. The table below lists canonical Gossamer call signatures; every item name links directly to its implementation file.
| Item | Canonical signature or declaration | Description |
|---|---|---|
Child |
type Child |
Handle to a still-running child supporting wait / kill. |
abort |
fn abort() -> ! |
Aborts the current process without unwinding. |
exit |
fn exit(code: i64) -> ! |
Exits the current process with the given status code. |
id |
fn id() -> i64 |
Returns the current process ID. |
kill |
fn kill(pid: i64) -> bool |
Sends SIGKILL (or equivalent) to a Child. |
kill_group |
fn kill_group(pid: i64) -> bool |
Sends a signal to a process group (POSIX). |
pipeline_run |
fn pipeline_run(commands: Vec<String>) -> Result<process::Output, errors::Error> |
Runs a shell-tokenised pipeline and returns captured stdout/stderr plus the final exit code. |
run |
fn run(program: String, args: Vec<String>) -> Result<process::Output, errors::Error> |
One-shot: runs a program with args, captures stdout/stderr plus the exit code. |
signal |
fn signal(pid: i64, signum: i64) -> bool |
Sends a signal to a process by PID (POSIX). |
spawn |
fn spawn(program: String, args: Vec<String>) -> Result<i64, errors::Error> |
Spawns a child process and returns its PID. |
spawn_piped |
fn spawn_piped(program: String, args: Vec<String>) -> Result<process::Child, errors::Error> |
Spawns a child with piped stdin/stdout; returns Result |
wait_timeout |
fn wait_timeout(pid: i64, ms: i64) -> i64 |
Waits for a child with a timeout (POSIX). |