wasix::lib_generated64

Function resolve

Source
pub unsafe fn resolve(
    host: &str,
    port: u16,
    addrs: *mut Addr,
    naddrs: Size,
) -> Result<Size, Errno>
Expand description

Resolves a hostname and a port to one or more IP addresses.

Note: This is similar to getaddrinfo in POSIX

When successful, the contents of the output buffer consist of a sequence of IPv4 and/or IPv6 addresses. Each address entry consists of a addr_t object. This function fills the output buffer as much as possible.

§Parameters

  • host - Host to resolve
  • port - Port hint (zero if no hint is supplied)
  • addrs - The buffer where addresses will be stored

§Return

The number of IP addresses returned during the DNS resolution.