diff options
Diffstat (limited to 'lib/std/os')
| -rw-r--r-- | lib/std/os/bits/windows.zig | 9 | ||||
| -rw-r--r-- | lib/std/os/windows/ws2_32.zig | 12 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lib/std/os/bits/windows.zig b/lib/std/os/bits/windows.zig index 505b348010..4988cafbe0 100644 --- a/lib/std/os/bits/windows.zig +++ b/lib/std/os/bits/windows.zig @@ -221,6 +221,15 @@ pub const SOCK_RAW = ws2_32.SOCK_RAW; pub const SOCK_RDM = ws2_32.SOCK_RDM; pub const SOCK_SEQPACKET = ws2_32.SOCK_SEQPACKET; +/// WARNING: this flag is not supported by windows socket functions directly, +/// it is only supported by std.os.socket. Be sure that this value does +/// not share any bits with any of the SOCK_* values. +pub const SOCK_CLOEXEC = 0x10000; +/// WARNING: this flag is not supported by windows socket functions directly, +/// it is only supported by std.os.socket. Be sure that this value does +/// not share any bits with any of the SOCK_* values. +pub const SOCK_NONBLOCK = 0x20000; + pub const IPPROTO_ICMP = ws2_32.IPPROTO_ICMP; pub const IPPROTO_IGMP = ws2_32.IPPROTO_IGMP; pub const BTHPROTO_RFCOMM = ws2_32.BTHPROTO_RFCOMM; diff --git a/lib/std/os/windows/ws2_32.zig b/lib/std/os/windows/ws2_32.zig index 6c1a712040..d1c400f2b3 100644 --- a/lib/std/os/windows/ws2_32.zig +++ b/lib/std/os/windows/ws2_32.zig @@ -174,6 +174,8 @@ pub const AI_SECURE = 0x08000; pub const AI_RETURN_PREFERRED_NAMES = 0x10000; pub const AI_DISABLE_IDN_ENCODING = 0x80000; +pub const FIONBIO = -2147195266; + pub const sockaddr = extern struct { family: ADDRESS_FAMILY, data: [14]u8, @@ -724,11 +726,6 @@ pub extern "ws2_32" fn WSAIoctl( lpOverlapped: ?*WSAOVERLAPPED, lpCompletionRoutine: ?WSAOVERLAPPED_COMPLETION_ROUTINE, ) callconv(.Stdcall) c_int; -pub extern "ws2_32" fn socket( - af: c_int, - type: c_int, - protocol: c_int, -) callconv(.Stdcall) SOCKET; pub extern "ws2_32" fn accept( s: SOCKET, addr: ?*sockaddr, @@ -788,3 +785,8 @@ pub extern "ws2_32" fn getaddrinfo( pub extern "ws2_32" fn freeaddrinfo( pAddrInfo: *addrinfo, ) callconv(.Stdcall) void; +pub extern "ws2_32" fn ioctlsocket( + s: SOCKET, + cmd: c_long, + argp: *c_ulong, +) callconv(.Stdcall) c_int; |
