authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-28 05:50:53-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:52-07:00
log4114392369c28a2455a508e4da67d945ebad2b44
treef46a75157ce0201b2bace2431acb601d2b4f40c8
parentf5870b267e96613fa31883dc89d469d132b1b5cd

std: fix definition of ws2_32.GetAddrInfoExW

There was a missing parameter.

2 files changed, 10 insertions(+), 9 deletions(-)

lib/std/Io/Threaded.zig+9-9
...@@ -4662,13 +4662,14 @@ fn netLookupFallible(...@@ -4662,13 +4662,14 @@ fn netLookupFallible(
4662 .provider = null,4662 .provider = null,
4663 .next = null,4663 .next = null,
4664 };4664 };
4665 const cancel_handle: ?*windows.HANDLE = null;
4665 var res: *ws2_32.ADDRINFOEXW = undefined;4666 var res: *ws2_32.ADDRINFOEXW = undefined;
4666 const timeout: ?*ws2_32.timeval = null;4667 const timeout: ?*ws2_32.timeval = null;
4667 while (true) {4668 while (true) {
4668 try t.checkCancel(); // TODO make requestCancel call GetAddrInfoExCancel4669 try t.checkCancel(); // TODO make requestCancel call GetAddrInfoExCancel
4669 // TODO make this append to the queue eagerly rather than blocking until4670 // TODO make this append to the queue eagerly rather than blocking until
4670 // the whole thing finishes4671 // the whole thing finishes
4671 const rc: ws2_32.WinsockError = @enumFromInt(ws2_32.GetAddrInfoExW(name_w, port_w, .DNS, null, &hints, &res, timeout, null, null));4672 const rc: ws2_32.WinsockError = @enumFromInt(ws2_32.GetAddrInfoExW(name_w, port_w, .DNS, null, &hints, &res, timeout, null, null, cancel_handle));
4672 switch (rc) {4673 switch (rc) {
4673 @as(ws2_32.WinsockError, @enumFromInt(0)) => break,4674 @as(ws2_32.WinsockError, @enumFromInt(0)) => break,
4674 .EINTR => continue,4675 .EINTR => continue,
...@@ -5732,17 +5733,16 @@ pub fn futexWake(ptr: *const std.atomic.Value(u32), max_waiters: u32) void {...@@ -5732,17 +5733,16 @@ pub fn futexWake(ptr: *const std.atomic.Value(u32), max_waiters: u32) void {
5732 } else switch (native_os) {5733 } else switch (native_os) {
5733 .linux => {5734 .linux => {
5734 const linux = std.os.linux;5735 const linux = std.os.linux;
5735 const rc = linux.futex_3arg(5736 switch (linux.E.init(linux.futex_3arg(
5736 &ptr.raw,5737 &ptr.raw,
5737 .{ .cmd = .WAKE, .private = true },5738 .{ .cmd = .WAKE, .private = true },
5738 @min(max_waiters, std.math.maxInt(i32)),5739 @min(max_waiters, std.math.maxInt(i32)),
5739 );5740 ))) {
5740 if (is_debug) switch (linux.E.init(rc)) {5741 .SUCCESS => return, // successful wake up
5741 .SUCCESS => {}, // successful wake up5742 .INVAL => return, // invalid futex_wait() on ptr done elsewhere
5742 .INVAL => {}, // invalid futex_wait() on ptr done elsewhere5743 .FAULT => return, // pointer became invalid while doing the wake
5743 .FAULT => {}, // pointer became invalid while doing the wake5744 else => return recoverableOsBugDetected(), // deadlock due to operating system bug
5744 else => unreachable, // deadlock due to operating system bug5745 }
5745 };
5746 },5746 },
5747 .driverkit, .ios, .macos, .tvos, .visionos, .watchos => {5747 .driverkit, .ios, .macos, .tvos, .visionos, .watchos => {
5748 const c = std.c;5748 const c = std.c;
lib/std/os/windows/ws2_32.zig+1
...@@ -2138,6 +2138,7 @@ pub extern "ws2_32" fn GetAddrInfoExW(...@@ -2138,6 +2138,7 @@ pub extern "ws2_32" fn GetAddrInfoExW(
2138 timeout: ?*timeval,2138 timeout: ?*timeval,
2139 lpOverlapped: ?*OVERLAPPED,2139 lpOverlapped: ?*OVERLAPPED,
2140 lpCompletionRoutine: ?LPLOOKUPSERVICE_COMPLETION_ROUTINE,2140 lpCompletionRoutine: ?LPLOOKUPSERVICE_COMPLETION_ROUTINE,
2141 lpNameHandle: ?*HANDLE,
2141) callconv(.winapi) i32;2142) callconv(.winapi) i32;
21422143
2143pub extern "ws2_32" fn GetAddrInfoExCancel(2144pub extern "ws2_32" fn GetAddrInfoExCancel(