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