irid-std 0.3.1

A replacement for std when running without a filesystem on the irid kernel
Documentation
use irid_syscall::ffi::thread::syscall_exit;

mod command;

pub use command::{Stdio, Command, Child};

pub fn exit(code: i32) -> ! {
    syscall_exit(code as isize)
}

#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ExitCode(isize);

impl ExitCode {
    pub const SUCCESS: ExitCode = ExitCode(0);
    pub const FAILURE: ExitCode = ExitCode(-1);
}

impl From<u8> for ExitCode {
    fn from(value: u8) -> Self {
        Self(value as isize)
    }
}

pub trait Termination {
    fn report(self) -> ExitCode;
}

impl Termination for ExitCode {
    fn report(self) -> ExitCode {
        self
    }
}