//! compiling for wasm. That way it's a compile time error for something that's
//! guaranteed to be a runtime error!
-use crate::os::raw::c_char;
use crate::intrinsics;
+use crate::os::raw::c_char;
pub mod alloc;
pub mod args;
-pub mod condvar;
-pub mod stdio;
-pub mod memchr;
-pub mod io;
-pub mod mutex;
-pub mod rwlock;
-pub mod os;
pub mod cmath;
-pub mod thread;
+pub mod condvar;
pub mod env;
-pub mod fs;
+pub mod fast_thread_local;
pub mod fd;
+pub mod fs;
+pub mod io;
+pub mod memchr;
+pub mod mutex;
pub mod net;
+pub mod os;
pub mod path;
pub mod pipe;
pub mod process;
+pub mod rwlock;
pub mod stack_overflow;
-pub mod time;
+pub mod stdio;
+pub mod thread;
pub mod thread_local;
-pub mod fast_thread_local;
+pub mod time;
-pub use crate::sys_common::os_str_bytes as os_str;
use crate::io::ErrorKind;
+pub use crate::sys_common::os_str_bytes as os_str;
#[allow(unused_extern_crates)]
pub extern crate hermit_abi as abi;
}
pub fn unsupported_err() -> crate::io::Error {
- crate::io::Error::new(crate::io::ErrorKind::Other,
- "operation not supported on HermitCore yet")
+ crate::io::Error::new(crate::io::ErrorKind::Other, "operation not supported on HermitCore yet")
}
// This enum is used as the storage for a bunch of types which can't actually
#[no_mangle]
pub extern "C" fn floor(x: f64) -> f64 {
- unsafe {
- intrinsics::floorf64(x)
- }
+ unsafe { intrinsics::floorf64(x) }
}
pub unsafe fn abort_internal() -> ! {
#[cfg(not(test))]
#[no_mangle]
-pub unsafe extern "C" fn runtime_entry(argc: i32, argv: *const *const c_char,
- env: *const *const c_char) -> ! {
+pub unsafe extern "C" fn runtime_entry(
+ argc: i32,
+ argv: *const *const c_char,
+ env: *const *const c_char,
+) -> ! {
extern "C" {
fn main(argc: isize, argv: *const *const c_char) -> i32;
}
}
pub fn cvt(result: i32) -> crate::io::Result<usize> {
- if result < 0 {
- Err(crate::io::Error::from_raw_os_error(-result))
- } else {
- Ok(result as usize)
- }
+ if result < 0 { Err(crate::io::Error::from_raw_os_error(-result)) } else { Ok(result as usize) }
}