@@ -536,7 +536,14 @@ pub(crate) fn symlinkat(
536
536
537
537
pub ( crate ) fn stat ( path : & CStr ) -> io:: Result < Stat > {
538
538
// 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
+ ) ) ]
540
547
{
541
548
match crate :: fs:: statx (
542
549
crate :: fs:: CWD ,
@@ -552,7 +559,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
552
559
553
560
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
554
561
// 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
+ ) ) ) ]
556
570
unsafe {
557
571
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
558
572
ret ( c:: stat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -562,7 +576,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
562
576
563
577
pub ( crate ) fn lstat ( path : & CStr ) -> io:: Result < Stat > {
564
578
// 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
+ ) ) ]
566
587
{
567
588
match crate :: fs:: statx (
568
589
crate :: fs:: CWD ,
@@ -578,7 +599,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
578
599
579
600
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
580
601
// 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
+ ) ) ) ]
582
610
unsafe {
583
611
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
584
612
ret ( c:: lstat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -589,7 +617,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
589
617
#[ cfg( not( any( target_os = "espidf" , target_os = "redox" ) ) ) ]
590
618
pub ( crate ) fn statat ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
591
619
// 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
+ ) ) ]
593
628
{
594
629
match crate :: fs:: statx ( dirfd, path, flags, StatxFlags :: BASIC_STATS ) {
595
630
Ok ( x) => statx_to_stat ( x) ,
@@ -600,7 +635,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
600
635
601
636
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
602
637
// 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
+ ) ) ) ]
604
646
unsafe {
605
647
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
606
648
ret ( c:: fstatat (
@@ -613,7 +655,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
613
655
}
614
656
}
615
657
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
+ ) ) ]
617
666
fn statat_old ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
618
667
unsafe {
619
668
let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1284,7 +1333,14 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
1284
1333
// And, some old platforms don't support `statx`, and some fail with a
1285
1334
// confusing error code, so we call `crate::fs::statx` to handle that. If
1286
1335
// `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
+ ) ) ]
1288
1344
{
1289
1345
match crate :: fs:: statx ( fd, cstr ! ( "" ) , AtFlags :: EMPTY_PATH , StatxFlags :: BASIC_STATS ) {
1290
1346
Ok ( x) => statx_to_stat ( x) ,
@@ -1295,15 +1351,29 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
1295
1351
1296
1352
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
1297
1353
// 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
+ ) ) ) ]
1299
1362
unsafe {
1300
1363
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
1301
1364
ret ( c:: fstat ( borrowed_fd ( fd) , stat. as_mut_ptr ( ) ) ) ?;
1302
1365
Ok ( stat. assume_init ( ) )
1303
1366
}
1304
1367
}
1305
1368
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
+ ) ) ]
1307
1377
fn fstat_old ( fd : BorrowedFd < ' _ > ) -> io:: Result < Stat > {
1308
1378
unsafe {
1309
1379
let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1663,7 +1733,7 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
1663
1733
/// Convert from a Linux `statx` value to rustix's `Stat`.
1664
1734
///
1665
1735
/// 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" ) ) ) ]
1667
1737
fn statx_to_stat ( x : crate :: fs:: Statx ) -> io:: Result < Stat > {
1668
1738
let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
1669
1739
@@ -1735,7 +1805,7 @@ fn stat64_to_stat(s64: c::stat64) -> io::Result<Stat> {
1735
1805
///
1736
1806
/// mips64' `struct stat64` in libc has private fields, and `st_blocks` has
1737
1807
/// type `i64`.
1738
- #[ cfg( all( linux_kernel, target_arch = "mips64" ) ) ]
1808
+ #[ cfg( all( linux_kernel, any ( target_arch = "mips64" , target_arch = "mips64r6" ) ) ) ]
1739
1809
fn stat64_to_stat ( s64 : c:: stat64 ) -> io:: Result < Stat > {
1740
1810
let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
1741
1811
0 commit comments