From 628bdeeb59a5a01625542ce80bb5692a52a73ea0 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 23 Sep 2024 10:22:32 -0600 Subject: [PATCH] Fix the definition of ino_t on 32-bit FreeBSD 12+ Commit 7437d0a6f1 erroneously defined it as "ulong" instead of u64. Nobody noticed the mistake, probably because it was only tested on 64-bit architectures, where those are equivalent. But it's a problem now, after #3723 , which switched the standard library to a FreeBSD 12 ABI. Issue https://github.com/rust-lang/rust/issues/130677 --- src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 2 +- src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 2 +- src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 2 +- src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 2 +- src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs index de34069eabdf2..68a8364194607 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -4,7 +4,7 @@ pub type nlink_t = u16; // Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12: pub type dev_t = u32; -// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12: +// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12: pub type ino_t = u32; s! { diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs index 10fcaa03a4ef6..197400ffb4e28 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -2,7 +2,7 @@ pub type nlink_t = u64; pub type dev_t = u64; -pub type ino_t = ::c_ulong; +pub type ino_t = u64; pub type shmatt_t = ::c_uint; s! { diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs index ec6bce2a03091..d3a77d03c48d0 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -2,7 +2,7 @@ pub type nlink_t = u64; pub type dev_t = u64; -pub type ino_t = ::c_ulong; +pub type ino_t = u64; pub type shmatt_t = ::c_uint; pub type kpaddr_t = u64; pub type kssize_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs index 160a4baae481b..9d65317d29cb4 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs @@ -2,7 +2,7 @@ pub type nlink_t = u64; pub type dev_t = u64; -pub type ino_t = ::c_ulong; +pub type ino_t = u64; pub type shmatt_t = ::c_uint; pub type kpaddr_t = u64; pub type kssize_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs index d73215a68ec33..f76208400f324 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs @@ -2,7 +2,7 @@ pub type nlink_t = u64; pub type dev_t = u64; -pub type ino_t = ::c_ulong; +pub type ino_t = u64; pub type shmatt_t = ::c_uint; pub type kpaddr_t = u64; pub type kssize_t = i64;