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(
46624662 .provider = null,
46634663 .next = null,
46644664 };
4665 const cancel_handle: ?*windows.HANDLE = null;
46654666 var res: *ws2_32.ADDRINFOEXW = undefined;
46664667 const timeout: ?*ws2_32.timeval = null;
46674668 while (true) {
46684669 try t.checkCancel(); // TODO make requestCancel call GetAddrInfoExCancel
46694670 // TODO make this append to the queue eagerly rather than blocking until
46704671 // 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));
46724673 switch (rc) {
46734674 @as(ws2_32.WinsockError, @enumFromInt(0)) => break,
46744675 .EINTR => continue,
......@@ -5732,17 +5733,16 @@ pub fn futexWake(ptr: *const std.atomic.Value(u32), max_waiters: u32) void {
57325733 } else switch (native_os) {
57335734 .linux => {
57345735 const linux = std.os.linux;
5735 const rc = linux.futex_3arg(
5736 switch (linux.E.init(linux.futex_3arg(
57365737 &ptr.raw,
57375738 .{ .cmd = .WAKE, .private = true },
57385739 @min(max_waiters, std.math.maxInt(i32)),
5739 );
5740 if (is_debug) switch (linux.E.init(rc)) {
5741 .SUCCESS => {}, // successful wake up
5742 .INVAL => {}, // invalid futex_wait() on ptr done elsewhere
5743 .FAULT => {}, // pointer became invalid while doing the wake
5744 else => unreachable, // deadlock due to operating system bug
5745 };
5740 ))) {
5741 .SUCCESS => return, // successful wake up
5742 .INVAL => return, // invalid futex_wait() on ptr done elsewhere
5743 .FAULT => return, // pointer became invalid while doing the wake
5744 else => return recoverableOsBugDetected(), // deadlock due to operating system bug
5745 }
57465746 },
57475747 .driverkit, .ios, .macos, .tvos, .visionos, .watchos => {
57485748 const c = std.c;
lib/std/os/windows/ws2_32.zig+1
......@@ -2138,6 +2138,7 @@ pub extern "ws2_32" fn GetAddrInfoExW(
21382138 timeout: ?*timeval,
21392139 lpOverlapped: ?*OVERLAPPED,
21402140 lpCompletionRoutine: ?LPLOOKUPSERVICE_COMPLETION_ROUTINE,
2141 lpNameHandle: ?*HANDLE,
21412142) callconv(.winapi) i32;
21422143
21432144pub extern "ws2_32" fn GetAddrInfoExCancel(