@@ -536,7 +536,14 @@ pub(crate) fn symlinkat(
536536
537537pub ( crate ) fn stat ( path : & CStr ) -> io:: Result < Stat > {
538538 // See the comments in `fstat` about using `crate::fs::statx` here.
539- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
539+ #[ cfg( all(
540+ linux_kernel,
541+ any(
542+ target_pointer_width = "32" ,
543+ target_arch = "mips64" ,
544+ target_arch = "mips64r6"
545+ )
546+ ) ) ]
540547 {
541548 match crate :: fs:: statx (
542549 crate :: fs:: CWD ,
@@ -552,7 +559,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
552559
553560 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
554561 // there's nothing practical we can do.
555- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
562+ #[ cfg( not( all(
563+ linux_kernel,
564+ any(
565+ target_pointer_width = "32" ,
566+ target_arch = "mips64" ,
567+ target_arch = "mips64r6"
568+ )
569+ ) ) ) ]
556570 unsafe {
557571 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
558572 ret ( c:: stat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -562,7 +576,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
562576
563577pub ( crate ) fn lstat ( path : & CStr ) -> io:: Result < Stat > {
564578 // See the comments in `fstat` about using `crate::fs::statx` here.
565- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
579+ #[ cfg( all(
580+ linux_kernel,
581+ any(
582+ target_pointer_width = "32" ,
583+ target_arch = "mips64" ,
584+ target_arch = "mips64r6"
585+ )
586+ ) ) ]
566587 {
567588 match crate :: fs:: statx (
568589 crate :: fs:: CWD ,
@@ -578,7 +599,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
578599
579600 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
580601 // there's nothing practical we can do.
581- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
602+ #[ cfg( not( all(
603+ linux_kernel,
604+ any(
605+ target_pointer_width = "32" ,
606+ target_arch = "mips64" ,
607+ target_arch = "mips64r6"
608+ )
609+ ) ) ) ]
582610 unsafe {
583611 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
584612 ret ( c:: lstat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -589,7 +617,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
589617#[ cfg( not( any( target_os = "espidf" , target_os = "redox" ) ) ) ]
590618pub ( crate ) fn statat ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
591619 // See the comments in `fstat` about using `crate::fs::statx` here.
592- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
620+ #[ cfg( all(
621+ linux_kernel,
622+ any(
623+ target_pointer_width = "32" ,
624+ target_arch = "mips64" ,
625+ target_arch = "mips64r6"
626+ )
627+ ) ) ]
593628 {
594629 match crate :: fs:: statx ( dirfd, path, flags, StatxFlags :: BASIC_STATS ) {
595630 Ok ( x) => statx_to_stat ( x) ,
@@ -600,7 +635,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
600635
601636 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
602637 // there's nothing practical we can do.
603- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
638+ #[ cfg( not( all(
639+ linux_kernel,
640+ any(
641+ target_pointer_width = "32" ,
642+ target_arch = "mips64" ,
643+ target_arch = "mips64r6"
644+ )
645+ ) ) ) ]
604646 unsafe {
605647 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
606648 ret ( c:: fstatat (
@@ -613,7 +655,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
613655 }
614656}
615657
616- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
658+ #[ cfg( all(
659+ linux_kernel,
660+ any(
661+ target_pointer_width = "32" ,
662+ target_arch = "mips64" ,
663+ target_arch = "mips64r6"
664+ )
665+ ) ) ]
617666fn statat_old ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
618667 unsafe {
619668 let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1284,7 +1333,14 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
12841333 // And, some old platforms don't support `statx`, and some fail with a
12851334 // confusing error code, so we call `crate::fs::statx` to handle that. If
12861335 // `statx` isn't available, fall back to the buggy system call.
1287- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
1336+ #[ cfg( all(
1337+ linux_kernel,
1338+ any(
1339+ target_pointer_width = "32" ,
1340+ target_arch = "mips64" ,
1341+ target_arch = "mips64r6"
1342+ )
1343+ ) ) ]
12881344 {
12891345 match crate :: fs:: statx ( fd, cstr ! ( "" ) , AtFlags :: EMPTY_PATH , StatxFlags :: BASIC_STATS ) {
12901346 Ok ( x) => statx_to_stat ( x) ,
@@ -1295,15 +1351,29 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
12951351
12961352 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
12971353 // there's nothing practical we can do.
1298- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
1354+ #[ cfg( not( all(
1355+ linux_kernel,
1356+ any(
1357+ target_pointer_width = "32" ,
1358+ target_arch = "mips64" ,
1359+ target_arch = "mips64r6"
1360+ )
1361+ ) ) ) ]
12991362 unsafe {
13001363 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
13011364 ret ( c:: fstat ( borrowed_fd ( fd) , stat. as_mut_ptr ( ) ) ) ?;
13021365 Ok ( stat. assume_init ( ) )
13031366 }
13041367}
13051368
1306- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
1369+ #[ cfg( all(
1370+ linux_kernel,
1371+ any(
1372+ target_pointer_width = "32" ,
1373+ target_arch = "mips64" ,
1374+ target_arch = "mips64r6"
1375+ )
1376+ ) ) ]
13071377fn fstat_old ( fd : BorrowedFd < ' _ > ) -> io:: Result < Stat > {
13081378 unsafe {
13091379 let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1663,7 +1733,7 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
16631733/// Convert from a Linux `statx` value to rustix's `Stat`.
16641734///
16651735/// mips64' `struct stat64` in libc has private fields, and `stx_blocks`
1666- #[ cfg( all( linux_kernel, target_arch = "mips64" ) ) ]
1736+ #[ cfg( all( linux_kernel, any ( target_arch = "mips64" , target_arch = "mips64r6" ) ) ) ]
16671737fn statx_to_stat ( x : crate :: fs:: Statx ) -> io:: Result < Stat > {
16681738 let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
16691739
@@ -1735,7 +1805,7 @@ fn stat64_to_stat(s64: c::stat64) -> io::Result<Stat> {
17351805///
17361806/// mips64' `struct stat64` in libc has private fields, and `st_blocks` has
17371807/// type `i64`.
1738- #[ cfg( all( linux_kernel, target_arch = "mips64" ) ) ]
1808+ #[ cfg( all( linux_kernel, any ( target_arch = "mips64" , target_arch = "mips64r6" ) ) ) ]
17391809fn stat64_to_stat ( s64 : c:: stat64 ) -> io:: Result < Stat > {
17401810 let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
17411811
0 commit comments