Skip to content

Commit d9b37d6

Browse files
committed
linux fixes recvmmsg flags type for musl/emscripten.
closes #2945
1 parent e4e865d commit d9b37d6

File tree

6 files changed

+96
-19
lines changed

6 files changed

+96
-19
lines changed

src/unix/linux_like/android/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,6 +2483,25 @@ pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15;
24832483
pub const SEEK_DATA: ::c_int = 3;
24842484
pub const SEEK_HOLE: ::c_int = 4;
24852485

2486+
pub const MSG_OOB: ::c_int = 1;
2487+
pub const MSG_PEEK: ::c_int = 2;
2488+
pub const MSG_DONTROUTE: ::c_int = 4;
2489+
pub const MSG_CTRUNC: ::c_int = 8;
2490+
pub const MSG_TRUNC: ::c_int = 0x20;
2491+
pub const MSG_DONTWAIT: ::c_int = 0x40;
2492+
pub const MSG_EOR: ::c_int = 0x80;
2493+
pub const MSG_WAITALL: ::c_int = 0x100;
2494+
pub const MSG_FIN: ::c_int = 0x200;
2495+
pub const MSG_SYN: ::c_int = 0x400;
2496+
pub const MSG_CONFIRM: ::c_int = 0x800;
2497+
pub const MSG_RST: ::c_int = 0x1000;
2498+
pub const MSG_ERRQUEUE: ::c_int = 0x2000;
2499+
pub const MSG_NOSIGNAL: ::c_int = 0x4000;
2500+
pub const MSG_MORE: ::c_int = 0x8000;
2501+
pub const MSG_WAITFORONE: ::c_int = 0x10000;
2502+
pub const MSG_FASTOPEN: ::c_int = 0x20000000;
2503+
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
2504+
24862505
// sys/socket.h
24872506
pub const AF_NFC: ::c_int = 39;
24882507
pub const AF_VSOCK: ::c_int = 40;

src/unix/linux_like/emscripten/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,25 @@ pub const PF_MPLS: ::c_int = AF_MPLS;
934934
pub const PF_NFC: ::c_int = AF_NFC;
935935
pub const PF_VSOCK: ::c_int = AF_VSOCK;
936936

937+
pub const MSG_OOB: ::c_uint = 1;
938+
pub const MSG_PEEK: ::c_uint = 2;
939+
pub const MSG_DONTROUTE: ::c_uint = 4;
940+
pub const MSG_CTRUNC: ::c_uint = 8;
941+
pub const MSG_TRUNC: ::c_uint = 0x20;
942+
pub const MSG_DONTWAIT: ::c_uint = 0x40;
943+
pub const MSG_EOR: ::c_uint = 0x80;
944+
pub const MSG_WAITALL: ::c_uint = 0x100;
945+
pub const MSG_FIN: ::c_uint = 0x200;
946+
pub const MSG_SYN: ::c_uint = 0x400;
947+
pub const MSG_CONFIRM: ::c_uint = 0x800;
948+
pub const MSG_RST: ::c_uint = 0x1000;
949+
pub const MSG_ERRQUEUE: ::c_uint = 0x2000;
950+
pub const MSG_NOSIGNAL: ::c_uint = 0x4000;
951+
pub const MSG_MORE: ::c_uint = 0x8000;
952+
pub const MSG_WAITFORONE: ::c_uint = 0x10000;
953+
pub const MSG_FASTOPEN: ::c_uint = 0x20000000;
954+
pub const MSG_CMSG_CLOEXEC: ::c_uint = 0x40000000;
955+
937956
// System V IPC
938957
pub const IPC_PRIVATE: ::key_t = 0;
939958

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,25 @@ pub const PF_NFC: ::c_int = AF_NFC;
729729
pub const PF_VSOCK: ::c_int = AF_VSOCK;
730730
pub const PF_XDP: ::c_int = AF_XDP;
731731

732+
pub const MSG_OOB: ::c_int = 1;
733+
pub const MSG_PEEK: ::c_int = 2;
734+
pub const MSG_DONTROUTE: ::c_int = 4;
735+
pub const MSG_CTRUNC: ::c_int = 8;
736+
pub const MSG_TRUNC: ::c_int = 0x20;
737+
pub const MSG_DONTWAIT: ::c_int = 0x40;
738+
pub const MSG_EOR: ::c_int = 0x80;
739+
pub const MSG_WAITALL: ::c_int = 0x100;
740+
pub const MSG_FIN: ::c_int = 0x200;
741+
pub const MSG_SYN: ::c_int = 0x400;
742+
pub const MSG_CONFIRM: ::c_int = 0x800;
743+
pub const MSG_RST: ::c_int = 0x1000;
744+
pub const MSG_ERRQUEUE: ::c_int = 0x2000;
745+
pub const MSG_NOSIGNAL: ::c_int = 0x4000;
746+
pub const MSG_MORE: ::c_int = 0x8000;
747+
pub const MSG_WAITFORONE: ::c_int = 0x10000;
748+
pub const MSG_FASTOPEN: ::c_int = 0x20000000;
749+
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
750+
732751
/* DCCP socket options */
733752
pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
734753
pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,25 @@ pub const PF_NFC: ::c_int = AF_NFC;
586586
pub const PF_VSOCK: ::c_int = AF_VSOCK;
587587
pub const PF_XDP: ::c_int = AF_XDP;
588588

589+
pub const MSG_OOB: ::c_uint = 1;
590+
pub const MSG_PEEK: ::c_uint = 2;
591+
pub const MSG_DONTROUTE: ::c_uint = 4;
592+
pub const MSG_CTRUNC: ::c_uint = 8;
593+
pub const MSG_TRUNC: ::c_uint = 0x20;
594+
pub const MSG_DONTWAIT: ::c_uint = 0x40;
595+
pub const MSG_EOR: ::c_uint = 0x80;
596+
pub const MSG_WAITALL: ::c_uint = 0x100;
597+
pub const MSG_FIN: ::c_uint = 0x200;
598+
pub const MSG_SYN: ::c_uint = 0x400;
599+
pub const MSG_CONFIRM: ::c_uint = 0x800;
600+
pub const MSG_RST: ::c_uint = 0x1000;
601+
pub const MSG_ERRQUEUE: ::c_uint = 0x2000;
602+
pub const MSG_NOSIGNAL: ::c_uint = 0x4000;
603+
pub const MSG_MORE: ::c_uint = 0x8000;
604+
pub const MSG_WAITFORONE: ::c_uint = 0x10000;
605+
pub const MSG_FASTOPEN: ::c_uint = 0x20000000;
606+
pub const MSG_CMSG_CLOEXEC: ::c_uint = 0x40000000;
607+
589608
pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
590609

591610
pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;

src/unix/linux_like/linux/uclibc/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,25 @@ pub const UDP_GRO: ::c_int = 104;
294294
pub const UDP_SEGMENT: ::c_int = 103;
295295
pub const YESEXPR: ::c_int = ((5) << 8) | (0);
296296

297+
pub const MSG_OOB: ::c_int = 1;
298+
pub const MSG_PEEK: ::c_int = 2;
299+
pub const MSG_DONTROUTE: ::c_int = 4;
300+
pub const MSG_CTRUNC: ::c_int = 8;
301+
pub const MSG_TRUNC: ::c_int = 0x20;
302+
pub const MSG_DONTWAIT: ::c_int = 0x40;
303+
pub const MSG_EOR: ::c_int = 0x80;
304+
pub const MSG_WAITALL: ::c_int = 0x100;
305+
pub const MSG_FIN: ::c_int = 0x200;
306+
pub const MSG_SYN: ::c_int = 0x400;
307+
pub const MSG_CONFIRM: ::c_int = 0x800;
308+
pub const MSG_RST: ::c_int = 0x1000;
309+
pub const MSG_ERRQUEUE: ::c_int = 0x2000;
310+
pub const MSG_NOSIGNAL: ::c_int = 0x4000;
311+
pub const MSG_MORE: ::c_int = 0x8000;
312+
pub const MSG_WAITFORONE: ::c_int = 0x10000;
313+
pub const MSG_FASTOPEN: ::c_int = 0x20000000;
314+
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
315+
297316
extern "C" {
298317
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
299318
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;

src/unix/linux_like/mod.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -759,25 +759,6 @@ pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
759759
pub const PF_CAIF: ::c_int = AF_CAIF;
760760
pub const PF_ALG: ::c_int = AF_ALG;
761761

762-
pub const MSG_OOB: ::c_int = 1;
763-
pub const MSG_PEEK: ::c_int = 2;
764-
pub const MSG_DONTROUTE: ::c_int = 4;
765-
pub const MSG_CTRUNC: ::c_int = 8;
766-
pub const MSG_TRUNC: ::c_int = 0x20;
767-
pub const MSG_DONTWAIT: ::c_int = 0x40;
768-
pub const MSG_EOR: ::c_int = 0x80;
769-
pub const MSG_WAITALL: ::c_int = 0x100;
770-
pub const MSG_FIN: ::c_int = 0x200;
771-
pub const MSG_SYN: ::c_int = 0x400;
772-
pub const MSG_CONFIRM: ::c_int = 0x800;
773-
pub const MSG_RST: ::c_int = 0x1000;
774-
pub const MSG_ERRQUEUE: ::c_int = 0x2000;
775-
pub const MSG_NOSIGNAL: ::c_int = 0x4000;
776-
pub const MSG_MORE: ::c_int = 0x8000;
777-
pub const MSG_WAITFORONE: ::c_int = 0x10000;
778-
pub const MSG_FASTOPEN: ::c_int = 0x20000000;
779-
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
780-
781762
pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
782763

783764
pub const SOCK_RAW: ::c_int = 3;
@@ -787,6 +768,7 @@ pub const IP_TTL: ::c_int = 2;
787768
pub const IP_HDRINCL: ::c_int = 3;
788769
pub const IP_OPTIONS: ::c_int = 4;
789770
pub const IP_ROUTER_ALERT: ::c_int = 5;
771+
790772
pub const IP_RECVOPTS: ::c_int = 6;
791773
pub const IP_RETOPTS: ::c_int = 7;
792774
pub const IP_PKTINFO: ::c_int = 8;

0 commit comments

Comments
 (0)