authorgravatar for successgdc@gmail.comDacheng Gao <successgdc@gmail.com> 2025-06-24 21:07:06+08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-06-24 15:07:06+02:00
log35329b510c26efdc95fdb79a041d8e0b04381126
treef397538ebde8546a3efcf5ae921ff4bc39586d65
parent342c34d95ebf27941e4edb64dd9363fc59f266d2
signaturebadge-check Signed by PGP key B5690EEEBB952194

c.darwin: define MSG for macos (#24224)

* c.darwin: define MSG for macos * darwin: add series os name * Update lib/std/c.zig Co-authored-by: Alex Rønne Petersen <alex@alexrp.com> --------- Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>

2 files changed, 40 insertions(+), 0 deletions(-)

lib/std/c.zig+1
...@@ -5598,6 +5598,7 @@ pub const MSG = switch (native_os) {...@@ -5598,6 +5598,7 @@ pub const MSG = switch (native_os) {
5598 .linux => linux.MSG,5598 .linux => linux.MSG,
5599 .emscripten => emscripten.MSG,5599 .emscripten => emscripten.MSG,
5600 .windows => ws2_32.MSG,5600 .windows => ws2_32.MSG,
5601 .driverkit, .macos, .ios, .tvos, .watchos, .visionos => darwin.MSG,
5601 .haiku => struct {5602 .haiku => struct {
5602 pub const OOB = 0x0001;5603 pub const OOB = 0x0001;
5603 pub const PEEK = 0x0002;5604 pub const PEEK = 0x0002;
lib/std/c/darwin.zig+39
...@@ -1553,3 +1553,42 @@ pub const TCP = struct {...@@ -1553,3 +1553,42 @@ pub const TCP = struct {
1553 /// State of the TCP connection1553 /// State of the TCP connection
1554 pub const CONNECTION_INFO = 0x106;1554 pub const CONNECTION_INFO = 0x106;
1555};1555};
1556
1557pub const MSG = struct {
1558 /// process out-of-band data
1559 pub const OOB = 0x1;
1560 /// peek at incoming message
1561 pub const PEEK = 0x2;
1562 /// send without using routing tables
1563 pub const DONTROUTE = 0x4;
1564 /// data completes record
1565 pub const EOR = 0x8;
1566 /// data discarded before delivery
1567 pub const TRUNC = 0x10;
1568 /// control data lost before delivery
1569 pub const CTRUNC = 0x20;
1570 /// wait for full request or error
1571 pub const WAITALL = 0x40;
1572 /// this message should be nonblocking
1573 pub const DONTWAIT = 0x80;
1574 /// data completes connection
1575 pub const EOF = 0x100;
1576 /// wait up to full request, may return partial
1577 pub const WAITSTREAM = 0x200;
1578 /// Start of 'hold' seq; dump so_temp, deprecated
1579 pub const FLUSH = 0x400;
1580 /// Hold frag in so_temp, deprecated
1581 pub const HOLD = 0x800;
1582 /// Send the packet in so_temp, deprecated
1583 pub const SEND = 0x1000;
1584 /// Data ready to be read
1585 pub const HAVEMORE = 0x2000;
1586 /// Data remains in current pkt
1587 pub const RCVMORE = 0x4000;
1588 /// Fail receive if socket address cannot be allocated
1589 pub const NEEDSA = 0x10000;
1590 /// do not generate SIGPIPE on EOF
1591 pub const NOSIGNAL = 0x80000;
1592 /// Inherit upcall in sock_accept
1593 pub const USEUPCALL = 0x80000000;
1594};