Skip to content

Commit 2d286b2

Browse files
committed
abi: st_nlink is u32 on aarch64
It turns out that st.st_nlink is u64 on x86_64 and powerpc64, and u32 on other architectures. Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent fb4b1c7 commit 2d286b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/abi/fuse_abi.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,12 @@ impl Attr {
610610
mode: st.st_mode,
611611
#[cfg(target_os = "macos")]
612612
mode: st.st_mode as u32,
613+
// st.st_nlink is u64 on x86_64 and powerpc64, and u32 on other architectures
614+
// ref https://github.com/rust-lang/rust/blob/1.69.0/library/std/src/os/linux/raw.rs#L333
615+
#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64"))]
613616
nlink: st.st_nlink as u32,
617+
#[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64")))]
618+
nlink: st.st_nlink,
614619
uid: st.st_uid,
615620
gid: st.st_gid,
616621
rdev: st.st_rdev as u32,

0 commit comments

Comments
 (0)