@@ -534,7 +534,14 @@ pub(crate) fn symlinkat(
534534
535535pub ( crate ) fn stat ( path : & CStr ) -> io:: Result < Stat > {
536536 // See the comments in `fstat` about using `crate::fs::statx` here.
537- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
537+ #[ cfg( all(
538+ linux_kernel,
539+ any(
540+ target_pointer_width = "32" ,
541+ target_arch = "mips64" ,
542+ target_arch = "mips64r6"
543+ )
544+ ) ) ]
538545 {
539546 match crate :: fs:: statx (
540547 crate :: fs:: CWD ,
@@ -550,7 +557,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
550557
551558 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
552559 // there's nothing practical we can do.
553- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
560+ #[ cfg( not( all(
561+ linux_kernel,
562+ any(
563+ target_pointer_width = "32" ,
564+ target_arch = "mips64" ,
565+ target_arch = "mips64r6"
566+ )
567+ ) ) ) ]
554568 unsafe {
555569 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
556570 ret ( c:: stat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -560,7 +574,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
560574
561575pub ( crate ) fn lstat ( path : & CStr ) -> io:: Result < Stat > {
562576 // See the comments in `fstat` about using `crate::fs::statx` here.
563- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
577+ #[ cfg( all(
578+ linux_kernel,
579+ any(
580+ target_pointer_width = "32" ,
581+ target_arch = "mips64" ,
582+ target_arch = "mips64r6"
583+ )
584+ ) ) ]
564585 {
565586 match crate :: fs:: statx (
566587 crate :: fs:: CWD ,
@@ -576,7 +597,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
576597
577598 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
578599 // there's nothing practical we can do.
579- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
600+ #[ cfg( not( all(
601+ linux_kernel,
602+ any(
603+ target_pointer_width = "32" ,
604+ target_arch = "mips64" ,
605+ target_arch = "mips64r6"
606+ )
607+ ) ) ) ]
580608 unsafe {
581609 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
582610 ret ( c:: lstat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -587,7 +615,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
587615#[ cfg( not( any( target_os = "espidf" , target_os = "redox" ) ) ) ]
588616pub ( crate ) fn statat ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
589617 // See the comments in `fstat` about using `crate::fs::statx` here.
590- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
618+ #[ cfg( all(
619+ linux_kernel,
620+ any(
621+ target_pointer_width = "32" ,
622+ target_arch = "mips64" ,
623+ target_arch = "mips64r6"
624+ )
625+ ) ) ]
591626 {
592627 match crate :: fs:: statx ( dirfd, path, flags, StatxFlags :: BASIC_STATS ) {
593628 Ok ( x) => statx_to_stat ( x) ,
@@ -598,7 +633,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
598633
599634 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
600635 // there's nothing practical we can do.
601- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
636+ #[ cfg( not( all(
637+ linux_kernel,
638+ any(
639+ target_pointer_width = "32" ,
640+ target_arch = "mips64" ,
641+ target_arch = "mips64r6"
642+ )
643+ ) ) ) ]
602644 unsafe {
603645 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
604646 ret ( c:: fstatat (
@@ -611,7 +653,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
611653 }
612654}
613655
614- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
656+ #[ cfg( all(
657+ linux_kernel,
658+ any(
659+ target_pointer_width = "32" ,
660+ target_arch = "mips64" ,
661+ target_arch = "mips64r6"
662+ )
663+ ) ) ]
615664fn statat_old ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
616665 unsafe {
617666 let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1282,7 +1331,14 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
12821331 // And, some old platforms don't support `statx`, and some fail with a
12831332 // confusing error code, so we call `crate::fs::statx` to handle that. If
12841333 // `statx` isn't available, fall back to the buggy system call.
1285- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
1334+ #[ cfg( all(
1335+ linux_kernel,
1336+ any(
1337+ target_pointer_width = "32" ,
1338+ target_arch = "mips64" ,
1339+ target_arch = "mips64r6"
1340+ )
1341+ ) ) ]
12861342 {
12871343 match crate :: fs:: statx ( fd, cstr ! ( "" ) , AtFlags :: EMPTY_PATH , StatxFlags :: BASIC_STATS ) {
12881344 Ok ( x) => statx_to_stat ( x) ,
@@ -1293,15 +1349,29 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
12931349
12941350 // Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
12951351 // there's nothing practical we can do.
1296- #[ cfg( not( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ) ]
1352+ #[ cfg( not( all(
1353+ linux_kernel,
1354+ any(
1355+ target_pointer_width = "32" ,
1356+ target_arch = "mips64" ,
1357+ target_arch = "mips64r6"
1358+ )
1359+ ) ) ) ]
12971360 unsafe {
12981361 let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
12991362 ret ( c:: fstat ( borrowed_fd ( fd) , stat. as_mut_ptr ( ) ) ) ?;
13001363 Ok ( stat. assume_init ( ) )
13011364 }
13021365}
13031366
1304- #[ cfg( all( linux_kernel, any( target_pointer_width = "32" , target_arch = "mips64" ) ) ) ]
1367+ #[ cfg( all(
1368+ linux_kernel,
1369+ any(
1370+ target_pointer_width = "32" ,
1371+ target_arch = "mips64" ,
1372+ target_arch = "mips64r6"
1373+ )
1374+ ) ) ]
13051375fn fstat_old ( fd : BorrowedFd < ' _ > ) -> io:: Result < Stat > {
13061376 unsafe {
13071377 let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1661,7 +1731,7 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
16611731/// Convert from a Linux `statx` value to rustix's `Stat`.
16621732///
16631733/// mips64' `struct stat64` in libc has private fields, and `stx_blocks`
1664- #[ cfg( all( linux_kernel, target_arch = "mips64" ) ) ]
1734+ #[ cfg( all( linux_kernel, any ( target_arch = "mips64" , target_arch = "mips64r6" ) ) ) ]
16651735fn statx_to_stat ( x : crate :: fs:: Statx ) -> io:: Result < Stat > {
16661736 let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
16671737
@@ -1733,7 +1803,7 @@ fn stat64_to_stat(s64: c::stat64) -> io::Result<Stat> {
17331803///
17341804/// mips64' `struct stat64` in libc has private fields, and `st_blocks` has
17351805/// type `i64`.
1736- #[ cfg( all( linux_kernel, target_arch = "mips64" ) ) ]
1806+ #[ cfg( all( linux_kernel, any ( target_arch = "mips64" , target_arch = "mips64r6" ) ) ) ]
17371807fn stat64_to_stat ( s64 : c:: stat64 ) -> io:: Result < Stat > {
17381808 let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
17391809
0 commit comments