From dd771677615328e59d552c73c1107ca3dc41dc43 Mon Sep 17 00:00:00 2001 From: shellrow Date: Tue, 16 Jun 2026 23:36:04 +0900 Subject: [PATCH] fix: add FreeBSD armv7 SIOCGIFXMEDIA support --- src/os/unix/link_speed.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/os/unix/link_speed.rs b/src/os/unix/link_speed.rs index f91d90a..2d0bfbf 100644 --- a/src/os/unix/link_speed.rs +++ b/src/os/unix/link_speed.rs @@ -114,6 +114,19 @@ const SIOCGIFXMEDIA: u64 = 0xc030698b; #[cfg(all(target_os = "freebsd", target_arch = "x86"))] const SIOCGIFXMEDIA: u32 = 0xc030698b; +#[cfg(all(target_os = "freebsd", target_arch = "arm"))] +// FreeBSD armv7 uses a 64-bit time_t and has a distinct ioctl value from i386. +const SIOCGIFXMEDIA: u32 = 0xc028698b; + +#[cfg(all( + target_os = "freebsd", + not(target_pointer_width = "64"), + not(target_arch = "x86"), + not(target_arch = "arm") +))] +// Fallback for unknown 32-bit FreeBSD architectures to keep builds working. +const SIOCGIFXMEDIA: u32 = 0xc028698b; + #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] // OpenBSD and netbsd don't define SIOCGIFXMEDIA. // Still using SIOCGIFXMEDIA as the variable name here.