@@ -378,7 +378,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
378378 events_op : & OpTy < ' tcx > ,
379379 maxevents : & OpTy < ' tcx > ,
380380 timeout : & OpTy < ' tcx > ,
381- ) -> InterpResult < ' tcx , Scalar > {
381+ place : & MPlaceTy < ' tcx > ,
382+ ) -> InterpResult < ' tcx > {
382383 let this = self . eval_context_mut ( ) ;
383384
384385 let epfd = this. read_scalar ( epfd) ?. to_i32 ( ) ?;
@@ -392,15 +393,18 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
392393 if epfd <= 0 {
393394 let einval = this. eval_libc ( "EINVAL" ) ;
394395 this. set_last_error ( einval) ?;
395- return Ok ( Scalar :: from_i32 ( -1 ) ) ;
396+ this. write_scalar ( Scalar :: from_i32 ( -1 ) , place) ?;
397+ return Ok ( ( ) ) ;
396398 }
397399 // FIXME: Implement blocking support
398400 if timeout != 0 {
399401 throw_unsup_format ! ( "epoll_wait: timeout value can only be 0" ) ;
400402 }
401403
402404 let Some ( epfd) = this. machine . fds . get_ref ( epfd) else {
403- return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
405+ let result_value = this. fd_not_found ( ) ?;
406+ this. write_scalar ( Scalar :: from_i32 ( result_value) , place) ?;
407+ return Ok ( ( ) ) ;
404408 } ;
405409 let mut binding = epfd. borrow_mut ( ) ;
406410 let epoll_file_description = & mut binding
@@ -431,7 +435,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
431435 }
432436 }
433437 }
434- Ok ( Scalar :: from_i32 ( num_of_events) )
438+ this. write_scalar ( Scalar :: from_i32 ( num_of_events) , place) ?;
439+ Ok ( ( ) )
435440 }
436441 /// For a specific unique file descriptor id, get its ready events and update
437442 /// the corresponding ready list. This function is called whenever a file description
0 commit comments