Unverified Commit f06af86a authored by Noa's avatar Noa
Browse files

Implement hstrerror

parent dbaeb8f0
Pipeline #9624 failed with stages
in 1 minute and 18 seconds
......@@ -893,3 +893,15 @@ pub extern "C" fn gai_strerror(errcode: c_int) -> *const c_char {
}
.as_ptr()
}
#[no_mangle]
pub extern "C" fn hstrerror(errcode: c_int) -> *const c_char {
match errcode {
HOST_NOT_FOUND => c_str!("Unknown hostname"),
NO_DATA => c_str!("No address for hostname"),
NO_RECOVERY => c_str!("Unknown server error"),
TRY_AGAIN => c_str!("Hostname lookup failure"),
_ => c_str!("Unknown error"),
}
.as_ptr()
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment