Skip to content

Commit d2f691a

Browse files
committed
Restricted to x64 gnu
1 parent ceac36d commit d2f691a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/sys/socket/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use libc::{self, c_void, c_int, iovec, socklen_t, size_t,
77
CMSG_FIRSTHDR, CMSG_NXTHDR, CMSG_DATA, CMSG_LEN};
88
use std::{mem, ptr, slice};
99
use std::os::unix::io::RawFd;
10-
#[cfg(target_os = "linux")]
10+
#[cfg(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86"), target_env = "gnu"))]
1111
use crate::sys::time::TimeSpec;
1212
use crate::sys::time::TimeVal;
1313
use crate::sys::uio::IoVec;
@@ -547,7 +547,7 @@ pub enum ControlMessageOwned {
547547
/// Nanoseconds resolution timestamp
548548
///
549549
/// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html)
550-
#[cfg(target_os = "linux")]
550+
#[cfg(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86"), target_env = "gnu"))]
551551
ScmTimestampNs(TimeSpec),
552552
#[cfg(any(
553553
target_os = "android",
@@ -640,7 +640,7 @@ impl ControlMessageOwned {
640640
let tv: libc::timeval = ptr::read_unaligned(p as *const _);
641641
ControlMessageOwned::ScmTimestamp(TimeVal::from(tv))
642642
},
643-
#[cfg(target_os = "linux")]
643+
#[cfg(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86"), target_env = "gnu"))]
644644
(libc::SOL_SOCKET, libc::SCM_TIMESTAMPNS) => {
645645
let ts: libc::timespec = ptr::read_unaligned(p as *const _);
646646
ControlMessageOwned::ScmTimestampNs(TimeSpec::from(ts))

src/sys/socket/sockopt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ sockopt_impl!(Both, BindToDevice, libc::SOL_SOCKET, libc::SO_BINDTODEVICE, OsStr
269269
#[cfg(any(target_os = "android", target_os = "linux"))]
270270
sockopt_impl!(GetOnly, OriginalDst, libc::SOL_IP, libc::SO_ORIGINAL_DST, libc::sockaddr_in);
271271
sockopt_impl!(Both, ReceiveTimestamp, libc::SOL_SOCKET, libc::SO_TIMESTAMP, bool);
272-
#[cfg(target_os = "linux")]
272+
#[cfg(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86"), target_env = "gnu"))]
273273
sockopt_impl!(Both, ReceiveTimestampNs, libc::SOL_SOCKET, libc::SO_TIMESTAMPNS, bool);
274274
#[cfg(any(target_os = "android", target_os = "linux"))]
275275
sockopt_impl!(Both, IpTransparent, libc::SOL_IP, libc::IP_TRANSPARENT, bool);

0 commit comments

Comments
 (0)