| ... | ... | @@ -13627,12 +13627,15 @@ fn netLookupFallible( |
| 13627 | 13627 | |
| 13628 | 13628 | // On Linux, glibc provides getaddrinfo_a which is capable of supporting our semantics. |
| 13629 | 13629 | // However, musl's POSIX-compliant getaddrinfo is not, so we bypass it. |
| 13630 | const is_glibc = builtin.link_libc and builtin.target.isGnuLibC(); |
| 13630 | 13631 | |
| 13631 | | if (builtin.target.isGnuLibC()) { |
| 13632 | if (is_glibc) { |
| 13632 | 13633 | // TODO use getaddrinfo_a / gai_cancel |
| 13633 | 13634 | } |
| 13634 | 13635 | |
| 13635 | | if (native_os == .linux or is_windows) { |
| 13636 | // On Linux, we have to go through glibc because of the Name Service Switch feature. |
| 13637 | const non_glibc_linux = native_os == .linux and !is_glibc; |
| 13638 | if (non_glibc_linux or is_windows) { |
| 13636 | 13639 | if (IpAddress.parseIp6(name, options.port)) |addr| { |
| 13637 | 13640 | if (options.family == .ip4) return error.UnknownHostName; |
| 13638 | 13641 | if (copyCanon(options.canonical_name_buffer, name)) |canon| { |