From 1ef0ebaf2f5dfaa8de6cf3e06c9a3170e7fe2f97 Mon Sep 17 00:00:00 2001 From: Dacheng Gao Date: Thu, 19 Jun 2025 22:11:23 +0800 Subject: [PATCH 1/3] c.darwin: define MSG for macos --- lib/std/c.zig | 1 + lib/std/c/darwin.zig | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/lib/std/c.zig b/lib/std/c.zig index 390d5f89c3cd..2ceb25ffcb70 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -5598,6 +5598,7 @@ pub const MSG = switch (native_os) { .linux => linux.MSG, .emscripten => emscripten.MSG, .windows => ws2_32.MSG, + .macos => darwin.MSG, .haiku => struct { pub const OOB = 0x0001; pub const PEEK = 0x0002; diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index 74d79842be25..cc94964a5f01 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -1553,3 +1553,42 @@ pub const TCP = struct { /// State of the TCP connection pub const CONNECTION_INFO = 0x106; }; + +pub const MSG = struct { + /// process out-of-band data + pub const OOB = 0x1; + /// peek at incoming message + pub const PEEK = 0x2; + /// send without using routing tables + pub const DONTROUTE = 0x4; + /// data completes record + pub const EOR = 0x8; + /// data discarded before delivery + pub const TRUNC = 0x10; + /// control data lost before delivery + pub const CTRUNC = 0x20; + /// wait for full request or error + pub const WAITALL = 0x40; + /// this message should be nonblocking + pub const DONTWAIT = 0x80; + /// data completes connection + pub const EOF = 0x100; + /// wait up to full request, may return partial + pub const WAITSTREAM = 0x200; + /// Start of 'hold' seq; dump so_temp, deprecated + pub const FLUSH = 0x400; + /// Hold frag in so_temp, deprecated + pub const HOLD = 0x800; + /// Send the packet in so_temp, deprecated + pub const SEND = 0x1000; + /// Data ready to be read + pub const HAVEMORE = 0x2000; + /// Data remains in current pkt + pub const RCVMORE = 0x4000; + /// Fail receive if socket address cannot be allocated + pub const NEEDSA = 0x10000; + /// do not generate SIGPIPE on EOF + pub const NOSIGNAL = 0x80000; + /// Inherit upcall in sock_accept + pub const USEUPCALL = 0x80000000; +}; From 5d764bd70c749a67267f6c133c7aeccc794c5571 Mon Sep 17 00:00:00 2001 From: Dacheng Gao Date: Thu, 19 Jun 2025 22:34:12 +0800 Subject: [PATCH 2/3] darwin: add series os name --- lib/std/c.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index 2ceb25ffcb70..9355456e255b 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -5598,7 +5598,7 @@ pub const MSG = switch (native_os) { .linux => linux.MSG, .emscripten => emscripten.MSG, .windows => ws2_32.MSG, - .macos => darwin.MSG, + .macos, .ios, .tvos, .watchos, .visionos => darwin.MSG, .haiku => struct { pub const OOB = 0x0001; pub const PEEK = 0x0002; From bf94b79bfa68e00c7dbdef70fe1bf6885e8560a9 Mon Sep 17 00:00:00 2001 From: Dacheng Date: Fri, 20 Jun 2025 16:15:36 +0800 Subject: [PATCH 3/3] Update lib/std/c.zig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alex Rønne Petersen --- lib/std/c.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index 9355456e255b..aabb54de497c 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -5598,7 +5598,7 @@ pub const MSG = switch (native_os) { .linux => linux.MSG, .emscripten => emscripten.MSG, .windows => ws2_32.MSG, - .macos, .ios, .tvos, .watchos, .visionos => darwin.MSG, + .driverkit, .macos, .ios, .tvos, .watchos, .visionos => darwin.MSG, .haiku => struct { pub const OOB = 0x0001; pub const PEEK = 0x0002;