Skip to content

Commit 7446004

Browse files
committed
Guard IP_TOS and IPV6_TCLASS only for linux
1 parent b5af7b4 commit 7446004

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎rules/socket/tgt_refcount.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,14 @@ fn f7(a0: i32, a1: i32, a2: i32, a3: AnyPtr, a4: u32) -> i32 {
249249
nix::sys::socket::setsockopt(&__fd, nix::sys::socket::sockopt::TcpKeepCount, &__v)
250250
})
251251
}
252+
#[cfg(target_os = "linux")]
252253
(::libc::IPPROTO_IP, ::libc::IP_TOS) => {
253254
let __v = a3.reinterpret_cast::<i32>().read();
254255
FdRegistry::with_fd(a0, |__fd| {
255256
nix::sys::socket::setsockopt(&__fd, nix::sys::socket::sockopt::Ipv4Tos, &__v)
256257
})
257258
}
259+
#[cfg(target_os = "linux")]
258260
(::libc::IPPROTO_IPV6, ::libc::IPV6_TCLASS) => {
259261
let __v = a3.reinterpret_cast::<i32>().read();
260262
FdRegistry::with_fd(a0, |__fd| {

‎tests/unit/out/refcount/sockopt.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ fn main_0() -> i32 {
9696
)
9797
})
9898
}
99+
#[cfg(target_os = "linux")]
99100
(::libc::IPPROTO_IP, ::libc::IP_TOS) => {
100101
let __v = ((on.as_pointer()) as Ptr<i32>)
101102
.to_any()
@@ -109,6 +110,7 @@ fn main_0() -> i32 {
109110
)
110111
})
111112
}
113+
#[cfg(target_os = "linux")]
112114
(::libc::IPPROTO_IPV6, ::libc::IPV6_TCLASS) => {
113115
let __v = ((on.as_pointer()) as Ptr<i32>)
114116
.to_any()
@@ -268,6 +270,7 @@ fn main_0() -> i32 {
268270
)
269271
})
270272
}
273+
#[cfg(target_os = "linux")]
271274
(::libc::IPPROTO_IP, ::libc::IP_TOS) => {
272275
let __v = ((on.as_pointer()) as Ptr<i32>)
273276
.to_any()
@@ -281,6 +284,7 @@ fn main_0() -> i32 {
281284
)
282285
})
283286
}
287+
#[cfg(target_os = "linux")]
284288
(::libc::IPPROTO_IPV6, ::libc::IPV6_TCLASS) => {
285289
let __v = ((on.as_pointer()) as Ptr<i32>)
286290
.to_any()

0 commit comments

Comments
 (0)