Function
gethostbyname
(name: PyUtf8StrRef, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 2934 | |
| 2935 | #[pyfunction] |
| 2936 | fn gethostbyname(name: PyUtf8StrRef, vm: &VirtualMachine) -> Result<String, IoOrPyException> { |
| 2937 | let addr = get_addr(vm, name, c::AF_INET)?; |
| 2938 | match addr { |
| 2939 | SocketAddr::V4(ip) => Ok(ip.ip().to_string()), |
| 2940 | _ => unreachable!(), |
| 2941 | } |
| 2942 | } |
| 2943 | |
| 2944 | #[pyfunction] |
| 2945 | fn gethostbyname_ex( |
Callers
nothing calls this directly
Tested by
no test coverage detected