Run world service policy in WASI init with pollable process observation

This commit is contained in:
2026-11-06 19:49:19 +00:00
parent b5462cc366
commit b39bbd4f18
21 changed files with 1821 additions and 224 deletions
+5 -1
View File
@@ -7,7 +7,10 @@ mod bindings {
}
use bindings::sausage::process::host;
pub use bindings::wasi::io::streams::{InputStream, OutputStream};
pub use host::Stdio;
pub use host::{Stdio, Watcher, Change, ChangeKind};
pub use bindings::wasi::io::poll::{Pollable, poll};
/// Hard-stop a process group by a live process ID.
pub fn kill(pid: u32) -> io::Result<()> { host::kill(pid).map_err(io::Error::other) }
/// A prepared child process.
pub struct Command {
@@ -63,6 +66,7 @@ pub struct Child {
}
impl Child {
pub fn id(&self) -> u32 { self.child.pid() }
pub fn subscribe(&self) -> Pollable { self.child.subscribe() }
pub fn try_wait(&self) -> Option<i32> { self.child.status() }
pub fn wait(&self) -> i32 { self.child.wait() }
/// Stop every process in this child's group.