Skip to content

Commit

Permalink
Auto merge of #3224 - stevenengler:wait-for-one, r=JohnTitor
Browse files Browse the repository at this point in the history
Add `MSG_WAITFORONE` to freebsd and openbsd

Adds `MSG_WAITFORONE` to freebsd, openbsd, and ~illumos~, as requested in nix-rust/nix#2014.

I got the values from:

- freebsd: http://fxr.watson.org/fxr/source/sys/socket.h#L473
- openbsd: https://github.com/openbsd/src/blob/2852e11abfc574a216ce741308fb0c6968d9617a/sys/sys/socket.h#L512
- illumos: https://github.com/illumos/illumos-gate/blob/717646f7112314de3f464bc0b75f034f009c861e/usr/src/boot/sys/sys/socket.h#L434

This flag is also supposedly supported on [solaris](https://docs.oracle.com/cd/E88353_01/html/E37843/recvmmsg-3c.html), but I don't know how to find the value. If anyone knows what it is, I'll add it to the PR.
  • Loading branch information
bors committed May 6, 2023
2 parents 7f9adf8 + 4e1f0e1 commit cc8a87b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ MSG_NBIO
MSG_NOERROR
MSG_NOSIGNAL
MSG_NOTIFICATION
MSG_WAITFORONE
NANOSECOND
NETGRAPHDISC
NET_RT_DUMP
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ MSG_CMSG_CLOEXEC
MSG_DONTWAIT
MSG_MCAST
MSG_NOSIGNAL
MSG_WAITFORONE
MNT_LAZY
MNT_NOWAIT
MNT_WAIT
Expand Down
1 change: 1 addition & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3696,6 +3696,7 @@ pub const MSG_NBIO: ::c_int = 0x00004000;
pub const MSG_COMPAT: ::c_int = 0x00008000;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
pub const MSG_NOSIGNAL: ::c_int = 0x20000;
pub const MSG_WAITFORONE: ::c_int = 0x00080000;

// utmpx entry types
pub const EMPTY: ::c_short = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,8 @@ pub const IP_RECVIF: ::c_int = 30;
pub const TCP_MD5SIG: ::c_int = 0x04;
pub const TCP_NOPUSH: ::c_int = 0x10;

pub const MSG_WAITFORONE: ::c_int = 0x1000;

pub const AF_ECMA: ::c_int = 8;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_ENCAP: ::c_int = 28;
Expand Down

0 comments on commit cc8a87b

Please sign in to comment.