Run world service policy in WASI init with pollable process observation
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user