diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-10-28 05:50:53 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-10-29 06:20:52 -0700 |
| commit | 4114392369c28a2455a508e4da67d945ebad2b44 (patch) | |
| tree | f46a75157ce0201b2bace2431acb601d2b4f40c8 /lib/std | |
| parent | f5870b267e96613fa31883dc89d469d132b1b5cd (diff) | |
| download | zig-4114392369c28a2455a508e4da67d945ebad2b44.tar.gz zig-4114392369c28a2455a508e4da67d945ebad2b44.zip | |
std: fix definition of ws2_32.GetAddrInfoExW
There was a missing parameter.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/Io/Threaded.zig | 18 | ||||
| -rw-r--r-- | lib/std/os/windows/ws2_32.zig | 1 |
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 58317e4d18..36b53f1a4d 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -4662,13 +4662,14 @@ fn netLookupFallible( .provider = null, .next = null, }; + const cancel_handle: ?*windows.HANDLE = null; var res: *ws2_32.ADDRINFOEXW = undefined; const timeout: ?*ws2_32.timeval = null; while (true) { try t.checkCancel(); // TODO make requestCancel call GetAddrInfoExCancel // TODO make this append to the queue eagerly rather than blocking until // the whole thing finishes - const rc: ws2_32.WinsockError = @enumFromInt(ws2_32.GetAddrInfoExW(name_w, port_w, .DNS, null, &hints, &res, timeout, null, null)); + const rc: ws2_32.WinsockError = @enumFromInt(ws2_32.GetAddrInfoExW(name_w, port_w, .DNS, null, &hints, &res, timeout, null, null, cancel_handle)); switch (rc) { @as(ws2_32.WinsockError, @enumFromInt(0)) => break, .EINTR => continue, @@ -5732,17 +5733,16 @@ pub fn futexWake(ptr: *const std.atomic.Value(u32), max_waiters: u32) void { } else switch (native_os) { .linux => { const linux = std.os.linux; - const rc = linux.futex_3arg( + switch (linux.E.init(linux.futex_3arg( &ptr.raw, .{ .cmd = .WAKE, .private = true }, @min(max_waiters, std.math.maxInt(i32)), - ); - if (is_debug) switch (linux.E.init(rc)) { - .SUCCESS => {}, // successful wake up - .INVAL => {}, // invalid futex_wait() on ptr done elsewhere - .FAULT => {}, // pointer became invalid while doing the wake - else => unreachable, // deadlock due to operating system bug - }; + ))) { + .SUCCESS => return, // successful wake up + .INVAL => return, // invalid futex_wait() on ptr done elsewhere + .FAULT => return, // pointer became invalid while doing the wake + else => return recoverableOsBugDetected(), // deadlock due to operating system bug + } }, .driverkit, .ios, .macos, .tvos, .visionos, .watchos => { const c = std.c; diff --git a/lib/std/os/windows/ws2_32.zig b/lib/std/os/windows/ws2_32.zig index 5d5e29c00e..d5c74e2212 100644 --- a/lib/std/os/windows/ws2_32.zig +++ b/lib/std/os/windows/ws2_32.zig @@ -2138,6 +2138,7 @@ pub extern "ws2_32" fn GetAddrInfoExW( timeout: ?*timeval, lpOverlapped: ?*OVERLAPPED, lpCompletionRoutine: ?LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: ?*HANDLE, ) callconv(.winapi) i32; pub extern "ws2_32" fn GetAddrInfoExCancel( |
