File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -610,11 +610,23 @@ impl Attr {
610
610
mode : st. st_mode ,
611
611
#[ cfg( target_os = "macos" ) ]
612
612
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" ) ) ]
613
+ // In Linux st.st_nlink is u64 on x86_64 and powerpc64, and u32 on other architectures
614
+ // In macos, st_nlink is always u16
615
+ // ref:
616
+ // linux: https://github.com/rust-lang/rust/blob/1.69.0/library/std/src/os/linux/raw.rs#L333
617
+ // macos: https://github.com/rust-lang/rust/blob/1.69.0/library/std/src/os/macos/raw.rs#L44
618
+ #[ cfg( any(
619
+ target_os = "macos" ,
620
+ all(
621
+ target_os = "linux" ,
622
+ any( target_arch = "x86_64" , target_arch = "powerpc64" )
623
+ )
624
+ ) ) ]
616
625
nlink : st. st_nlink as u32 ,
617
- #[ cfg( not( any( target_arch = "x86_64" , target_arch = "powerpc64" ) ) ) ]
626
+ #[ cfg( all(
627
+ target_os = "linux" ,
628
+ not( any( target_arch = "x86_64" , target_arch = "powerpc64" ) )
629
+ ) ) ]
618
630
nlink : st. st_nlink ,
619
631
uid : st. st_uid ,
620
632
gid : st. st_gid ,
You can’t perform that action at this time.
0 commit comments