Skip to content
Snippets Groups Projects
Commit 4b90afeb authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'hstrerror' into 'master'

Implement hstrerror

See merge request redox-os/relibc!341
parents 3eb52eab 3373d5e2
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ build:linux:
stage: build
script:
- rustup toolchain add "$(cat rust-toolchain)"
- rustup component add rust-src
- rustup show # Print version info for debugging
- make -j "$(nproc)" all
......
......@@ -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()
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment