@@ -261,6 +261,55 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
261
261
this. try_unwrap_io_result ( result)
262
262
}
263
263
264
+ fn stat ( & mut self ,
265
+ _path_op : OpTy < ' tcx , Tag > ,
266
+ buf_op : OpTy < ' tcx , Tag > ,
267
+ ) -> InterpResult < ' tcx , i32 > {
268
+ let this = self . eval_context_mut ( ) ;
269
+
270
+ let buf = this. deref_operand ( buf_op) ?;
271
+
272
+ let dev_t_layout = this. libc_ty_layout ( "dev_t" ) ?;
273
+ let mode_t_layout = this. libc_ty_layout ( "mode_t" ) ?;
274
+ let nlink_t_layout = this. libc_ty_layout ( "nlink_t" ) ?;
275
+ let ino_t_layout = this. libc_ty_layout ( "ino_t" ) ?;
276
+ let uid_t_layout = this. libc_ty_layout ( "uid_t" ) ?;
277
+ let gid_t_layout = this. libc_ty_layout ( "gid_t" ) ?;
278
+ let time_t_layout = this. libc_ty_layout ( "time_t" ) ?;
279
+ let long_layout = this. libc_ty_layout ( "c_long" ) ?;
280
+ let off_t_layout = this. libc_ty_layout ( "off_t" ) ?;
281
+ let blkcnt_t_layout = this. libc_ty_layout ( "blkcnt_t" ) ?;
282
+ let blksize_t_layout = this. libc_ty_layout ( "blksize_t" ) ?;
283
+ let uint32_t_layout = this. libc_ty_layout ( "uint32_t" ) ?;
284
+
285
+ let imms = [
286
+ immty_from_uint_checked ( 0u128 , dev_t_layout) ?, // st_dev
287
+ immty_from_uint_checked ( 0u128 , mode_t_layout) ?, // st_mode
288
+ immty_from_uint_checked ( 0u128 , nlink_t_layout) ?, // st_nlink
289
+ immty_from_uint_checked ( 0u128 , ino_t_layout) ?, // st_ino
290
+ immty_from_uint_checked ( 0u128 , uid_t_layout) ?, // st_uid
291
+ immty_from_uint_checked ( 0u128 , gid_t_layout) ?, // st_gid
292
+ immty_from_uint_checked ( 0u128 , dev_t_layout) ?, // st_rdev
293
+ immty_from_uint_checked ( 0u128 , time_t_layout) ?, // st_atime
294
+ immty_from_uint_checked ( 0u128 , long_layout) ?, // st_atime_nsec
295
+ immty_from_uint_checked ( 0u128 , time_t_layout) ?, // st_mtime
296
+ immty_from_uint_checked ( 0u128 , long_layout) ?, // st_mtime_nsec
297
+ immty_from_uint_checked ( 0u128 , time_t_layout) ?, // st_ctime
298
+ immty_from_uint_checked ( 0u128 , long_layout) ?, // st_ctime_nsec
299
+ immty_from_uint_checked ( 0u128 , time_t_layout) ?, // st_birthtime
300
+ immty_from_uint_checked ( 0u128 , long_layout) ?, // st_birthtime_nsec
301
+ immty_from_uint_checked ( 0u128 , off_t_layout) ?, // st_size
302
+ immty_from_uint_checked ( 0u128 , blkcnt_t_layout) ?, // st_blocks
303
+ immty_from_uint_checked ( 0u128 , blksize_t_layout) ?, // st_blksize
304
+ immty_from_uint_checked ( 0u128 , uint32_t_layout) ?, // st_flags
305
+ immty_from_uint_checked ( 0u128 , uint32_t_layout) ?, // st_gen
306
+ ] ;
307
+
308
+ this. write_packed_immediates ( & buf, & imms) ?;
309
+
310
+ Ok ( 0 )
311
+ }
312
+
264
313
fn statx (
265
314
& mut self ,
266
315
dirfd_op : OpTy < ' tcx , Tag > , // Should be an `int`
0 commit comments