You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
707 B

//! For POSIX and system calls
use super::*;
use cfg_if::cfg_if;
pub mod user;
pub mod pipe;
pub mod fork;
pub mod errno;
#[allow(unused_imports)]
use errno::ResultExt;
/// Get pid of current process
#[inline] pub fn get_pid() -> i32
{
unsafe{libc::getpid()}
}
/// Start the async runtime manually
pub fn new_runtime() -> Result<tokio::runtime::Runtime, tokio::io::Error>
{
use tokio::runtime::Builder;
cfg_if! {
if #[cfg(feature="threaded")] {
Builder::new()
.enable_all()
.threaded_scheduler()
.thread_name("sys invoked runtime")
.build()
} else {
Builder::new()
.enable_all()
.basic_scheduler()
.thread_name("sys invoked runtime")
.build()
}
}
}