99// Only available on Linux
1010//
1111// spell-checker:ignore CLOEXEC RDONLY TOCTOU closedir dirp fdopendir fstatat openat REMOVEDIR unlinkat smallfile
12- // spell-checker:ignore RAII dirfd fchownat fchown FchmodatFlags fchmodat fchmod
12+ // spell-checker:ignore RAII dirfd fchownat fchown FchmodatFlags fchmodat fchmod atim mtim ctim
1313
1414#[ cfg( test) ]
1515use std:: os:: unix:: ffi:: OsStringExt ;
@@ -471,7 +471,15 @@ impl std::os::unix::fs::MetadataExt for Metadata {
471471 fn atime ( & self ) -> i64 {
472472 #[ cfg( target_pointer_width = "32" ) ]
473473 {
474- self . stat . st_atime . into ( )
474+ #[ cfg( target_env = "musl" , target_arch = "x86" ) ]
475+ {
476+ self . stat . st_atim . into ( )
477+ }
478+
479+ #[ cfg( not( target_env = "musl" , target_arch = "x86" ) ) ]
480+ {
481+ self . stat . st_atime . into ( )
482+ }
475483 }
476484 #[ cfg( not( target_pointer_width = "32" ) ) ]
477485 {
@@ -482,7 +490,15 @@ impl std::os::unix::fs::MetadataExt for Metadata {
482490 fn atime_nsec ( & self ) -> i64 {
483491 #[ cfg( target_pointer_width = "32" ) ]
484492 {
485- self . stat . st_atime_nsec . into ( )
493+ #[ cfg( target_env = "musl" , target_arch = "x86" ) ]
494+ {
495+ self . stat . st_atim_nsec . into ( )
496+ }
497+
498+ #[ cfg( not( target_env = "musl" , target_arch = "x86" ) ) ]
499+ {
500+ self . stat . st_atime_nsec . into ( )
501+ }
486502 }
487503 #[ cfg( not( target_pointer_width = "32" ) ) ]
488504 {
@@ -493,7 +509,15 @@ impl std::os::unix::fs::MetadataExt for Metadata {
493509 fn mtime ( & self ) -> i64 {
494510 #[ cfg( target_pointer_width = "32" ) ]
495511 {
496- self . stat . st_mtime . into ( )
512+ #[ cfg( target_env = "musl" , target_arch = "x86" ) ]
513+ {
514+ self . stat . st_mtim . into ( )
515+ }
516+
517+ #[ cfg( not( target_env = "musl" , target_arch = "x86" ) ) ]
518+ {
519+ self . stat . st_mtime . into ( )
520+ }
497521 }
498522 #[ cfg( not( target_pointer_width = "32" ) ) ]
499523 {
@@ -504,7 +528,15 @@ impl std::os::unix::fs::MetadataExt for Metadata {
504528 fn mtime_nsec ( & self ) -> i64 {
505529 #[ cfg( target_pointer_width = "32" ) ]
506530 {
507- self . stat . st_mtime_nsec . into ( )
531+ #[ cfg( target_env = "musl" , target_arch = "x86" ) ]
532+ {
533+ self . stat . st_mtim_nsec . into ( )
534+ }
535+
536+ #[ cfg( not( target_env = "musl" , target_arch = "x86" ) ) ]
537+ {
538+ self . stat . st_mtime_nsec . into ( )
539+ }
508540 }
509541 #[ cfg( not( target_pointer_width = "32" ) ) ]
510542 {
@@ -515,7 +547,15 @@ impl std::os::unix::fs::MetadataExt for Metadata {
515547 fn ctime ( & self ) -> i64 {
516548 #[ cfg( target_pointer_width = "32" ) ]
517549 {
518- self . stat . st_ctime . into ( )
550+ #[ cfg( target_env = "musl" , target_arch = "x86" ) ]
551+ {
552+ self . stat . st_ctim . into ( )
553+ }
554+
555+ #[ cfg( not( target_env = "musl" , target_arch = "x86" ) ) ]
556+ {
557+ self . stat . st_ctime . into ( )
558+ }
519559 }
520560 #[ cfg( not( target_pointer_width = "32" ) ) ]
521561 {
@@ -526,7 +566,15 @@ impl std::os::unix::fs::MetadataExt for Metadata {
526566 fn ctime_nsec ( & self ) -> i64 {
527567 #[ cfg( target_pointer_width = "32" ) ]
528568 {
529- self . stat . st_ctime_nsec . into ( )
569+ #[ cfg( target_env = "musl" , target_arch = "x86" ) ]
570+ {
571+ self . stat . st_ctim_nsec . into ( )
572+ }
573+
574+ #[ cfg( not( target_env = "musl" , target_arch = "x86" ) ) ]
575+ {
576+ self . stat . st_ctime_nsec . into ( )
577+ }
530578 }
531579 #[ cfg( not( target_pointer_width = "32" ) ) ]
532580 {
0 commit comments