@@ -10,7 +10,7 @@ use std::rc::Weak;
1010
1111use rustc_target:: abi:: Size ;
1212
13- use crate :: shims:: unix:: linux:: epoll:: { EpollEventInstance , EpollReadyEvents } ;
13+ use crate :: shims:: unix:: linux:: epoll:: EpollReadyEvents ;
1414use crate :: shims:: unix:: * ;
1515use crate :: * ;
1616
@@ -263,6 +263,7 @@ impl FileDescriptionRef {
263263 & self ,
264264 ecx : & mut InterpCx < ' tcx , MiriMachine < ' tcx > > ,
265265 ) -> InterpResult < ' tcx , ( ) > {
266+ use crate :: shims:: unix:: linux:: epoll:: EvalContextExt ;
266267 ecx. check_and_update_readiness ( self . get_id ( ) , || self . borrow_mut ( ) . get_epoll_ready_events ( ) )
267268 }
268269}
@@ -384,41 +385,6 @@ impl FdTable {
384385
385386impl < ' tcx > EvalContextExt < ' tcx > for crate :: MiriInterpCx < ' tcx > { }
386387pub trait EvalContextExt < ' tcx > : crate :: MiriInterpCxExt < ' tcx > {
387- /// For a specific unique file descriptor id, get its ready events and update
388- /// the corresponding ready list.
389- fn check_and_update_readiness (
390- & self ,
391- id : FdId ,
392- get_ready_events : impl FnOnce ( ) -> InterpResult < ' tcx , EpollReadyEvents > ,
393- ) -> InterpResult < ' tcx , ( ) > {
394- let this = self . eval_context_ref ( ) ;
395- // Get a list of EpollEventInterest that is associated to a specific file description.
396- if let Some ( epoll_interests) = this. machine . epoll_interests . get_epoll_interest ( id) {
397- let epoll_ready_events = get_ready_events ( ) ?;
398- // Get the bitmask of ready events.
399- let ready_events = epoll_ready_events. get_event_bitmask ( this) ;
400-
401- for weak_epoll_interest in epoll_interests {
402- if let Some ( epoll_interest) = weak_epoll_interest. upgrade ( ) {
403- // This checks if any of the events specified in epoll_event_interest.events
404- // match those in ready_events.
405- let epoll_event_interest = epoll_interest. borrow ( ) ;
406- let flags = epoll_event_interest. events & ready_events;
407- // If there is any event that we are interested in being specified as ready,
408- // insert an epoll_return to the ready list.
409- if flags != 0 {
410- let epoll_key = ( id, epoll_event_interest. file_descriptor ) ;
411- let ready_list = & mut epoll_event_interest. ready_list . borrow_mut ( ) ;
412- let event_instance =
413- EpollEventInstance :: new ( flags, epoll_event_interest. data ) ;
414- ready_list. insert ( epoll_key, event_instance) ;
415- }
416- }
417- }
418- }
419- Ok ( ( ) )
420- }
421-
422388 fn dup ( & mut self , old_fd : i32 ) -> InterpResult < ' tcx , Scalar > {
423389 let this = self . eval_context_mut ( ) ;
424390
0 commit comments