Skip to content

Commit 35329b5

Browse files
dacheng-gaoalexrp
andauthored
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>
1 parent 342c34d commit 35329b5

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

lib/std/c.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5598,6 +5598,7 @@ pub const MSG = switch (native_os) {
55985598
.linux => linux.MSG,
55995599
.emscripten => emscripten.MSG,
56005600
.windows => ws2_32.MSG,
5601+
.driverkit, .macos, .ios, .tvos, .watchos, .visionos => darwin.MSG,
56015602
.haiku => struct {
56025603
pub const OOB = 0x0001;
56035604
pub const PEEK = 0x0002;

lib/std/c/darwin.zig

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,3 +1553,42 @@ pub const TCP = struct {
15531553
/// State of the TCP connection
15541554
pub const CONNECTION_INFO = 0x106;
15551555
};
1556+
1557+
pub 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+
};

0 commit comments

Comments
 (0)