@@ -534,7 +534,14 @@ pub(crate) fn symlinkat(
534
534
535
535
pub ( crate ) fn stat ( path : & CStr ) -> io:: Result < Stat > {
536
536
// 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
+ ) ) ]
538
545
{
539
546
match crate :: fs:: statx (
540
547
crate :: fs:: CWD ,
@@ -550,7 +557,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
550
557
551
558
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
552
559
// 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
+ ) ) ) ]
554
568
unsafe {
555
569
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
556
570
ret ( c:: stat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -560,7 +574,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
560
574
561
575
pub ( crate ) fn lstat ( path : & CStr ) -> io:: Result < Stat > {
562
576
// 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
+ ) ) ]
564
585
{
565
586
match crate :: fs:: statx (
566
587
crate :: fs:: CWD ,
@@ -576,7 +597,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
576
597
577
598
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
578
599
// 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
+ ) ) ) ]
580
608
unsafe {
581
609
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
582
610
ret ( c:: lstat ( c_str ( path) , stat. as_mut_ptr ( ) ) ) ?;
@@ -587,7 +615,14 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
587
615
#[ cfg( not( any( target_os = "espidf" , target_os = "redox" ) ) ) ]
588
616
pub ( crate ) fn statat ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
589
617
// 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
+ ) ) ]
591
626
{
592
627
match crate :: fs:: statx ( dirfd, path, flags, StatxFlags :: BASIC_STATS ) {
593
628
Ok ( x) => statx_to_stat ( x) ,
@@ -598,7 +633,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
598
633
599
634
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
600
635
// 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
+ ) ) ) ]
602
644
unsafe {
603
645
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
604
646
ret ( c:: fstatat (
@@ -611,7 +653,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
611
653
}
612
654
}
613
655
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
+ ) ) ]
615
664
fn statat_old ( dirfd : BorrowedFd < ' _ > , path : & CStr , flags : AtFlags ) -> io:: Result < Stat > {
616
665
unsafe {
617
666
let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1282,7 +1331,14 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
1282
1331
// And, some old platforms don't support `statx`, and some fail with a
1283
1332
// confusing error code, so we call `crate::fs::statx` to handle that. If
1284
1333
// `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
+ ) ) ]
1286
1342
{
1287
1343
match crate :: fs:: statx ( fd, cstr ! ( "" ) , AtFlags :: EMPTY_PATH , StatxFlags :: BASIC_STATS ) {
1288
1344
Ok ( x) => statx_to_stat ( x) ,
@@ -1293,15 +1349,29 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
1293
1349
1294
1350
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
1295
1351
// 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
+ ) ) ) ]
1297
1360
unsafe {
1298
1361
let mut stat = MaybeUninit :: < Stat > :: uninit ( ) ;
1299
1362
ret ( c:: fstat ( borrowed_fd ( fd) , stat. as_mut_ptr ( ) ) ) ?;
1300
1363
Ok ( stat. assume_init ( ) )
1301
1364
}
1302
1365
}
1303
1366
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
+ ) ) ]
1305
1375
fn fstat_old ( fd : BorrowedFd < ' _ > ) -> io:: Result < Stat > {
1306
1376
unsafe {
1307
1377
let mut result = MaybeUninit :: < c:: stat64 > :: uninit ( ) ;
@@ -1661,7 +1731,7 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
1661
1731
/// Convert from a Linux `statx` value to rustix's `Stat`.
1662
1732
///
1663
1733
/// 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" ) ) ) ]
1665
1735
fn statx_to_stat ( x : crate :: fs:: Statx ) -> io:: Result < Stat > {
1666
1736
let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
1667
1737
@@ -1733,7 +1803,7 @@ fn stat64_to_stat(s64: c::stat64) -> io::Result<Stat> {
1733
1803
///
1734
1804
/// mips64' `struct stat64` in libc has private fields, and `st_blocks` has
1735
1805
/// type `i64`.
1736
- #[ cfg( all( linux_kernel, target_arch = "mips64" ) ) ]
1806
+ #[ cfg( all( linux_kernel, any ( target_arch = "mips64" , target_arch = "mips64r6" ) ) ) ]
1737
1807
fn stat64_to_stat ( s64 : c:: stat64 ) -> io:: Result < Stat > {
1738
1808
let mut result: Stat = unsafe { core:: mem:: zeroed ( ) } ;
1739
1809
0 commit comments