mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std: fix definition of ws2_32.GetAddrInfoExW
There was a missing parameter.
This commit is contained in:
parent
f5870b267e
commit
4114392369
@ -4662,13 +4662,14 @@ fn netLookupFallible(
|
|||||||
.provider = null,
|
.provider = null,
|
||||||
.next = null,
|
.next = null,
|
||||||
};
|
};
|
||||||
|
const cancel_handle: ?*windows.HANDLE = null;
|
||||||
var res: *ws2_32.ADDRINFOEXW = undefined;
|
var res: *ws2_32.ADDRINFOEXW = undefined;
|
||||||
const timeout: ?*ws2_32.timeval = null;
|
const timeout: ?*ws2_32.timeval = null;
|
||||||
while (true) {
|
while (true) {
|
||||||
try t.checkCancel(); // TODO make requestCancel call GetAddrInfoExCancel
|
try t.checkCancel(); // TODO make requestCancel call GetAddrInfoExCancel
|
||||||
// TODO make this append to the queue eagerly rather than blocking until
|
// TODO make this append to the queue eagerly rather than blocking until
|
||||||
// the whole thing finishes
|
// 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) {
|
switch (rc) {
|
||||||
@as(ws2_32.WinsockError, @enumFromInt(0)) => break,
|
@as(ws2_32.WinsockError, @enumFromInt(0)) => break,
|
||||||
.EINTR => continue,
|
.EINTR => continue,
|
||||||
@ -5732,17 +5733,16 @@ pub fn futexWake(ptr: *const std.atomic.Value(u32), max_waiters: u32) void {
|
|||||||
} else switch (native_os) {
|
} else switch (native_os) {
|
||||||
.linux => {
|
.linux => {
|
||||||
const linux = std.os.linux;
|
const linux = std.os.linux;
|
||||||
const rc = linux.futex_3arg(
|
switch (linux.E.init(linux.futex_3arg(
|
||||||
&ptr.raw,
|
&ptr.raw,
|
||||||
.{ .cmd = .WAKE, .private = true },
|
.{ .cmd = .WAKE, .private = true },
|
||||||
@min(max_waiters, std.math.maxInt(i32)),
|
@min(max_waiters, std.math.maxInt(i32)),
|
||||||
);
|
))) {
|
||||||
if (is_debug) switch (linux.E.init(rc)) {
|
.SUCCESS => return, // successful wake up
|
||||||
.SUCCESS => {}, // successful wake up
|
.INVAL => return, // invalid futex_wait() on ptr done elsewhere
|
||||||
.INVAL => {}, // invalid futex_wait() on ptr done elsewhere
|
.FAULT => return, // pointer became invalid while doing the wake
|
||||||
.FAULT => {}, // pointer became invalid while doing the wake
|
else => return recoverableOsBugDetected(), // deadlock due to operating system bug
|
||||||
else => unreachable, // deadlock due to operating system bug
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
.driverkit, .ios, .macos, .tvos, .visionos, .watchos => {
|
.driverkit, .ios, .macos, .tvos, .visionos, .watchos => {
|
||||||
const c = std.c;
|
const c = std.c;
|
||||||
|
|||||||
@ -2138,6 +2138,7 @@ pub extern "ws2_32" fn GetAddrInfoExW(
|
|||||||
timeout: ?*timeval,
|
timeout: ?*timeval,
|
||||||
lpOverlapped: ?*OVERLAPPED,
|
lpOverlapped: ?*OVERLAPPED,
|
||||||
lpCompletionRoutine: ?LPLOOKUPSERVICE_COMPLETION_ROUTINE,
|
lpCompletionRoutine: ?LPLOOKUPSERVICE_COMPLETION_ROUTINE,
|
||||||
|
lpNameHandle: ?*HANDLE,
|
||||||
) callconv(.winapi) i32;
|
) callconv(.winapi) i32;
|
||||||
|
|
||||||
pub extern "ws2_32" fn GetAddrInfoExCancel(
|
pub extern "ws2_32" fn GetAddrInfoExCancel(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user