/// Gets a detailed string description for the given error number.
Gets a detailed string description for the given error number.
Gets a detailed string description for the given error number .
pub fn error_string(errno: i32) -> String {
	extern "C" {
		fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t) -> c_int;
	}
	let mut buf = [0 as c_char; TMPBUF_SZ];
	let p = buf.as_mut_ptr();
	unsafe {
		if strerror_r(errno as c_int, p, buf.len()) < 0 {
			panic!("strerror_r failure");
		}
		let p = p as *const _;
		str::from_utf8(CStr::from_ptr(p).to_bytes())
			.unwrap()
			.to_owned()
	}
}
pub fn error_string ( errno : i32 ) -> String { extern " " { fn strerror_r ( errnum : c_int , buf : * mut c_char , buflen : libc :: size_t ) -> c_int ; } let mut buf = [ 0 as c_char ; TMPBUF_SZ ] ; let p = buf . as_mut_ptr ( ) ; unsafe { if strerror_r ( errno as c_int , p , buf . len ( ) ) < 0 { panic ! ( " " ) ; } let p = p as * const _ ; str :: from_utf8 ( CStr :: from_ptr ( p ) . to_bytes ( ) ) . unwrap ( ) . to_owned ( ) } }
Gets a detailed string description for the given error number.
Gets a detailed string description for the given error number .
errno
i32