oscall 0.0.2

Low-level cross-platform interface to operating system services: files, memory mapping, networking and more, with no libc on Linux
Documentation
//! Other processes on WebAssembly: there are none.

use crate::{ErrorKind, Result};

pub(crate) const HAS_PROCESSES: bool = false;
pub(crate) const SEARCH_SEPARATOR: u8 = b':';
pub(crate) const DIR_SEPARATOR: &[u8] = b"/";
pub(crate) const PROGRAM_SUFFIX: &[u8] = b"";

pub(crate) fn search_dir(entry: &[u8]) -> &[u8] {
    entry
}

pub(crate) fn is_bare_name(name: &[u8]) -> bool {
    !name.contains(&b'/')
}

pub(crate) fn is_program(_path: &[u8]) -> bool {
    false
}

pub(crate) fn exists(_pid: u32) -> Result<bool> {
    Err(ErrorKind::Unsupported.into())
}

pub(crate) fn kill(_pid: u32) -> Result<()> {
    Err(ErrorKind::Unsupported.into())
}

pub(crate) fn resource_usage() -> Result<crate::process::ResourceUsage> {
    Err(ErrorKind::Unsupported.into())
}

/// Signals: there are none either.
pub(crate) mod signal {
    use core::time::Duration;

    use crate::process::Wake;
    use crate::{ErrorKind, Result};

    pub(crate) const HANGUP: i32 = 1;
    pub(crate) const INTERRUPT: i32 = 2;
    pub(crate) const TERMINATE: i32 = 15;

    /// Never exists: nothing can be listened to.
    #[derive(Debug)]
    pub(crate) enum Signals {}

    impl Signals {
        pub(crate) fn new(_signals: &[i32]) -> Result<Self> {
            Err(ErrorKind::Unsupported.into())
        }

        pub(crate) fn try_next(&self) -> Option<i32> {
            match *self {}
        }

        pub(crate) fn wait_once(&self, _timeout: Option<Duration>) -> Result<Wake> {
            match *self {}
        }
    }
}