@@ -903,10 +903,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
903903 fn readdir64 ( & mut self , dirent_type : & str , dirp_op : & OpTy < ' tcx > ) -> InterpResult < ' tcx , Scalar > {
904904 let this = self . eval_context_mut ( ) ;
905905
906- if !matches ! (
907- & * this. tcx. sess. target. os,
908- "linux" | "solaris" | "illumos" | "macos" | "freebsd"
909- ) {
906+ if !matches ! ( & * this. tcx. sess. target. os, "linux" | "solaris" | "illumos" | "freebsd" ) {
910907 panic ! ( "`linux_solaris_readdir64` should not be called on {}" , this. tcx. sess. target. os) ;
911908 }
912909
@@ -955,16 +952,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
955952 // pub d_namlen: uint8_t,
956953 // pub d_name: [c_char; 256]
957954 // }
958- //
959- // On Macos:
960- // pub struct dirent {
961- // pub d_ino: u64,
962- // pub d_seekoff: u64,
963- // pub d_reclen: u16,
964- // pub d_namlen: u16,
965- // pub d_type: u8,
966- // pub d_name: [c_char; 1024],
967- // }
968955
969956 let mut name = dir_entry. file_name ( ) ; // not a Path as there are no separators!
970957 name. push ( "\0 " ) ; // Add a NUL terminator
@@ -995,13 +982,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
995982 // Write common fields
996983 let ino_name =
997984 if this. tcx . sess . target . os == "freebsd" { "d_fileno" } else { "d_ino" } ;
998- let off_name =
999- if this. tcx . sess . target . os == "macos" { "d_seekoff" } else { "d_off" } ;
1000985 this. write_int_fields_named (
1001- & [ ( ino_name, ino. into ( ) ) , ( off_name , 0 ) , ( "d_reclen" , size. into ( ) ) ] ,
986+ & [ ( ino_name, ino. into ( ) ) , ( "d_reclen" , size. into ( ) ) ] ,
1002987 & entry,
1003988 ) ?;
1004989
990+ if let Some ( d_off) = this. try_project_field_named ( & entry, "d_off" ) ? {
991+ this. write_null ( & d_off) ?;
992+ }
993+
1005994 if let Some ( d_namlen) = this. try_project_field_named ( & entry, "d_namlen" ) ? {
1006995 this. write_int ( name_len. strict_sub ( 1 ) , & d_namlen) ?;
1007996 }
0 commit comments