Skip to content

Commit f348eb7

Browse files
authored
Merge pull request #172 from shellrow/fix/freebsd-arch-portability
fix: improve FreeBSD architecture portability
2 parents 91687e4 + dd77167 commit f348eb7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎src/os/unix/link_speed.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ const SIOCGIFXMEDIA: u64 = 0xc030698b;
114114
#[cfg(all(target_os = "freebsd", target_arch = "x86"))]
115115
const SIOCGIFXMEDIA: u32 = 0xc030698b;
116116

117+
#[cfg(all(target_os = "freebsd", target_arch = "arm"))]
118+
// FreeBSD armv7 uses a 64-bit time_t and has a distinct ioctl value from i386.
119+
const SIOCGIFXMEDIA: u32 = 0xc028698b;
120+
121+
#[cfg(all(
122+
target_os = "freebsd",
123+
not(target_pointer_width = "64"),
124+
not(target_arch = "x86"),
125+
not(target_arch = "arm")
126+
))]
127+
// Fallback for unknown 32-bit FreeBSD architectures to keep builds working.
128+
const SIOCGIFXMEDIA: u32 = 0xc028698b;
129+
117130
#[cfg(any(target_os = "openbsd", target_os = "netbsd"))]
118131
// OpenBSD and netbsd don't define SIOCGIFXMEDIA.
119132
// Still using SIOCGIFXMEDIA as the variable name here.

0 commit comments

Comments
 (0)