@@ -118,7 +118,7 @@ impl UnixFileDescription for FileHandle {
118118
119119impl < ' tcx > EvalContextExtPrivate < ' tcx > for crate :: MiriInterpCx < ' tcx > { }
120120trait EvalContextExtPrivate < ' tcx > : crate :: MiriInterpCxExt < ' tcx > {
121- fn macos_fbsd_solarish_write_stat_buf (
121+ fn write_stat_buf (
122122 & mut self ,
123123 metadata : FileMetadata ,
124124 buf_op : & OpTy < ' tcx > ,
@@ -141,8 +141,11 @@ trait EvalContextExtPrivate<'tcx>: crate::MiriInterpCxExt<'tcx> {
141141 ( "st_gid" , metadata. gid . into ( ) ) ,
142142 ( "st_rdev" , 0 ) ,
143143 ( "st_atime" , access_sec. into ( ) ) ,
144+ ( "st_atime_nsec" , access_nsec. into ( ) ) ,
144145 ( "st_mtime" , modified_sec. into ( ) ) ,
146+ ( "st_mtime_nsec" , modified_nsec. into ( ) ) ,
145147 ( "st_ctime" , 0 ) ,
148+ ( "st_ctime_nsec" , 0 ) ,
146149 ( "st_size" , metadata. size . into ( ) ) ,
147150 ( "st_blocks" , 0 ) ,
148151 ( "st_blksize" , 0 ) ,
@@ -550,7 +553,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
550553 Err ( err) => return this. set_last_error_and_return_i32 ( err) ,
551554 } ;
552555
553- interp_ok ( Scalar :: from_i32 ( this. macos_fbsd_solarish_write_stat_buf ( metadata, buf_op) ?) )
556+ interp_ok ( Scalar :: from_i32 ( this. write_stat_buf ( metadata, buf_op) ?) )
554557 }
555558
556559 // `lstat` is used to get symlink metadata.
@@ -583,22 +586,17 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
583586 Err ( err) => return this. set_last_error_and_return_i32 ( err) ,
584587 } ;
585588
586- interp_ok ( Scalar :: from_i32 ( this. macos_fbsd_solarish_write_stat_buf ( metadata, buf_op) ?) )
589+ interp_ok ( Scalar :: from_i32 ( this. write_stat_buf ( metadata, buf_op) ?) )
587590 }
588591
589- fn macos_fbsd_solarish_fstat (
590- & mut self ,
591- fd_op : & OpTy < ' tcx > ,
592- buf_op : & OpTy < ' tcx > ,
593- ) -> InterpResult < ' tcx , Scalar > {
592+ fn fstat ( & mut self , fd_op : & OpTy < ' tcx > , buf_op : & OpTy < ' tcx > ) -> InterpResult < ' tcx , Scalar > {
594593 let this = self . eval_context_mut ( ) ;
595594
596- if !matches ! ( & this. tcx. sess. target. os, Os :: MacOs | Os :: FreeBsd | Os :: Solaris | Os :: Illumos )
597- {
598- panic ! (
599- "`macos_fbsd_solaris_fstat` should not be called on {}" ,
600- this. tcx. sess. target. os
601- ) ;
595+ if !matches ! (
596+ & this. tcx. sess. target. os,
597+ Os :: MacOs | Os :: FreeBsd | Os :: Solaris | Os :: Illumos | Os :: Linux
598+ ) {
599+ panic ! ( "`fstat` should not be called on {}" , this. tcx. sess. target. os) ;
602600 }
603601
604602 let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
@@ -614,7 +612,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
614612 Ok ( metadata) => metadata,
615613 Err ( err) => return this. set_last_error_and_return_i32 ( err) ,
616614 } ;
617- interp_ok ( Scalar :: from_i32 ( this. macos_fbsd_solarish_write_stat_buf ( metadata, buf_op) ?) )
615+ interp_ok ( Scalar :: from_i32 ( this. write_stat_buf ( metadata, buf_op) ?) )
618616 }
619617
620618 fn linux_statx (
0 commit comments