6 pub use crate::sys::cloudabi::shims::os::*;
8 pub fn errno() -> i32 {
14 unsafe { errno as i32 }
17 /// Gets a detailed string description for the given error number.
18 pub fn error_string(errno: i32) -> String {
19 // cloudlibc's strerror() is guaranteed to be thread-safe. There is
20 // thus no need to use strerror_r().
21 str::from_utf8(unsafe { CStr::from_ptr(libc::strerror(errno)) }.to_bytes())
26 pub fn exit(code: i32) -> ! {
27 unsafe { libc::exit(code as c_int) }