silk/os_child_process
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu.
Native ChildProcess provider with source-owned request staging and per-call captures.
When to use
Construct OsChildProcess at a native application edge and provide it as ChildProcess.
Details
Each invocation owns its request staging, descriptors, child and output buffers. Nonzero exit codes and signals are outcome data. Recoverable failures release resources and reap the child.
Gotchas
Execution blocks. The provider is absent on unsupported and no-libc profiles. Fatal traps do not guarantee cleanup. The host must not separately reap a child owned by this provider. On GNU Linux, a startup failure whose error notice cannot write even one byte is indistinguishable from successful exec followed by exit 127. A partially delivered notice is a provider failure.
Examples
Construct a provider without starting a process
import silk.os_child_process {OsChildProcess}
pub fn main() -> i32 {
let provider = OsChildProcess.make()
drop provider
return 42
}Import as OsChildProcess with import silk.os_child_process { OsChildProcess }.
Public declarations: 1.
OsChildProcess
pub struct OsChildProcessA stateless provider whose executions each own their native resources and captures.
Associated function OsChildProcess.make
pub fn make() -> OsChildProcessCreates a provider without allocating storage or starting a child.
Implementation ChildProcess for OsChildProcess
impl ChildProcess for OsChildProcessOperation execute
execute = OsChildProcess.execute