authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-27 16:17:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-27 16:17:14-07:00
log908970df1c9a509c73d24a566292db2fba049498
tree1413eb4098192839af35df2e498ccc31a3a25f53
parentbc948d7a44ac16260cde81fa94c2723876fd1391

std.Io.Threaded: go through glibc on linux for DNS

This was intended all along

1 files changed, 5 insertions(+), 2 deletions(-)

lib/std/Io/Threaded.zig+5-2
......@@ -13627,12 +13627,15 @@ fn netLookupFallible(
1362713627
1362813628 // On Linux, glibc provides getaddrinfo_a which is capable of supporting our semantics.
1362913629 // However, musl's POSIX-compliant getaddrinfo is not, so we bypass it.
13630 const is_glibc = builtin.link_libc and builtin.target.isGnuLibC();
1363013631
13631 if (builtin.target.isGnuLibC()) {
13632 if (is_glibc) {
1363213633 // TODO use getaddrinfo_a / gai_cancel
1363313634 }
1363413635
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) {
1363613639 if (IpAddress.parseIp6(name, options.port)) |addr| {
1363713640 if (options.family == .ip4) return error.UnknownHostName;
1363813641 if (copyCanon(options.canonical_name_buffer, name)) |canon| {