mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
21 lines
448 B
Rust
21 lines
448 B
Rust
use std::{os::raw::c_int, time::Duration};
|
|
|
|
use anyhow::Result;
|
|
use tokio::time::sleep;
|
|
use xenstore::{XsdClient, XsdInterface};
|
|
|
|
pub mod background;
|
|
pub mod childwait;
|
|
pub mod init;
|
|
|
|
pub async fn death(code: c_int) -> Result<()> {
|
|
let store = XsdClient::open().await?;
|
|
store
|
|
.write_string("krata/guest/exit-code", &code.to_string())
|
|
.await?;
|
|
drop(store);
|
|
loop {
|
|
sleep(Duration::from_secs(1)).await;
|
|
}
|
|
}
|