rustix/backend/libc/net/
send_recv.rs1use crate::backend::c;
2use bitflags::bitflags;
3
4bitflags! {
5 #[repr(transparent)]
11 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
12 pub struct SendFlags: u32 {
13 #[cfg(not(any(
15 bsd,
16 solarish,
17 windows,
18 target_os = "aix",
19 target_os = "cygwin",
20 target_os = "espidf",
21 target_os = "nto",
22 target_os = "haiku",
23 target_os = "horizon",
24 target_os = "hurd",
25 target_os = "redox",
26 target_os = "vita",
27 )))]
28 const CONFIRM = bitcast!(c::MSG_CONFIRM);
29 const DONTROUTE = bitcast!(c::MSG_DONTROUTE);
31 #[cfg(not(windows))]
33 const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
34 #[cfg(not(any(windows, target_os = "horizon")))]
36 const EOR = bitcast!(c::MSG_EOR);
37 #[cfg(not(any(
39 bsd,
40 solarish,
41 windows,
42 target_os = "aix",
43 target_os = "cygwin",
44 target_os = "haiku",
45 target_os = "hurd",
46 target_os = "nto",
47 target_os = "redox",
48 target_os = "vita",
49 )))]
50 const MORE = bitcast!(c::MSG_MORE);
51 #[cfg(not(any(apple, windows, target_os = "redox", target_os = "vita")))]
52 const NOSIGNAL = bitcast!(c::MSG_NOSIGNAL);
54 const OOB = bitcast!(c::MSG_OOB);
56
57 const _ = !0;
59 }
60}
61
62bitflags! {
63 #[repr(transparent)]
69 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
70 pub struct RecvFlags: u32 {
71 #[cfg(not(any(
73 apple,
74 solarish,
75 windows,
76 target_os = "aix",
77 target_os = "espidf",
78 target_os = "haiku",
79 target_os = "horizon",
80 target_os = "nto",
81 target_os = "redox",
82 target_os = "vita",
83 )))]
84 const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC);
85 #[cfg(not(windows))]
87 const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
88 #[cfg(not(any(
90 bsd,
91 solarish,
92 windows,
93 target_os = "aix",
94 target_os = "cygwin",
95 target_os = "espidf",
96 target_os = "haiku",
97 target_os = "horizon",
98 target_os = "hurd",
99 target_os = "nto",
100 target_os = "redox",
101 target_os = "vita",
102 )))]
103 const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE);
104 const OOB = bitcast!(c::MSG_OOB);
106 const PEEK = bitcast!(c::MSG_PEEK);
108 #[cfg(not(any(apple, solarish, target_os = "horizon", target_os = "netbsd")))]
113 const TRUNC = bitcast!(c::MSG_TRUNC);
114 const WAITALL = bitcast!(c::MSG_WAITALL);
116
117 const _ = !0;
119 }
120}
121
122bitflags! {
123 #[repr(transparent)]
129 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
130 pub struct ReturnFlags: u32 {
131 const OOB = bitcast!(c::MSG_OOB);
133 #[cfg(not(any(windows, target_os = "horizon")))]
135 const EOR = bitcast!(c::MSG_EOR);
136 #[cfg(not(target_os = "horizon"))]
138 const TRUNC = bitcast!(c::MSG_TRUNC);
139 #[cfg(not(target_os = "horizon"))]
141 const CTRUNC = bitcast!(c::MSG_CTRUNC);
142
143 #[cfg(linux_kernel)]
145 const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC);
146 #[cfg(linux_kernel)]
148 const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE);
149
150 const _ = !0;
152 }
153}