diff --git a/library/std/src/sys/pal/mikros/os.rs b/library/std/src/sys/pal/mikros/os.rs index 26f7a10b21a..58d20d0499b 100644 --- a/library/std/src/sys/pal/mikros/os.rs +++ b/library/std/src/sys/pal/mikros/os.rs @@ -3,7 +3,8 @@ use crate::error::Error as StdError; use crate::ffi::{OsStr, OsString}; use crate::marker::PhantomData; -use crate::os::mikros::Errno; +use crate::os::mikros::ipc::rpc; +use crate::os::mikros::{Errno, syscalls}; use crate::path::{self, PathBuf}; use crate::{fmt, io}; @@ -251,7 +252,11 @@ pub fn home_dir() -> Option { None } -pub fn exit(_code: i32) -> ! { +pub fn exit(code: i32) -> ! { + if let Some(proc_man_pid) = syscalls::try_get_registered(3) { + rpc::send_call(proc_man_pid, 2, 4, &postcard::to_allocvec(&(code as u8)).unwrap()) + .get_return(); + }; unsafe { asm!("int 0x80", in("rax") 1); };