@@ -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
@@ -270,6 +270,7 @@ impl FileDescriptionRef {
270270 & self ,
271271 ecx : & mut InterpCx < ' tcx , MiriMachine < ' tcx > > ,
272272 ) -> InterpResult < ' tcx , ( ) > {
273+ use crate :: shims:: unix:: linux:: epoll:: EvalContextExt ;
273274 ecx. check_and_update_readiness ( self . get_id ( ) , || self . borrow_mut ( ) . get_epoll_ready_events ( ) )
274275 }
275276}
@@ -391,41 +392,6 @@ impl FdTable {
391392
392393impl < ' tcx > EvalContextExt < ' tcx > for crate :: MiriInterpCx < ' tcx > { }
393394pub trait EvalContextExt < ' tcx > : crate :: MiriInterpCxExt < ' tcx > {
394- /// For a specific unique file descriptor id, get its ready events and update
395- /// the corresponding ready list.
396- fn check_and_update_readiness (
397- & self ,
398- id : FdId ,
399- get_ready_events : impl FnOnce ( ) -> InterpResult < ' tcx , EpollReadyEvents > ,
400- ) -> InterpResult < ' tcx , ( ) > {
401- let this = self . eval_context_ref ( ) ;
402- // Get a list of EpollEventInterest that is associated to a specific file description.
403- if let Some ( epoll_interests) = this. machine . epoll_interests . get_epoll_interest ( id) {
404- let epoll_ready_events = get_ready_events ( ) ?;
405- // Get the bitmask of ready events.
406- let ready_events = epoll_ready_events. get_event_bitmask ( this) ;
407-
408- for weak_epoll_interest in epoll_interests {
409- if let Some ( epoll_interest) = weak_epoll_interest. upgrade ( ) {
410- // This checks if any of the events specified in epoll_event_interest.events
411- // match those in ready_events.
412- let epoll_event_interest = epoll_interest. borrow ( ) ;
413- let flags = epoll_event_interest. events & ready_events;
414- // If there is any event that we are interested in being specified as ready,
415- // insert an epoll_return to the ready list.
416- if flags != 0 {
417- let epoll_key = ( id, epoll_event_interest. file_descriptor ) ;
418- let ready_list = & mut epoll_event_interest. ready_list . borrow_mut ( ) ;
419- let event_instance =
420- EpollEventInstance :: new ( flags, epoll_event_interest. data ) ;
421- ready_list. insert ( epoll_key, event_instance) ;
422- }
423- }
424- }
425- }
426- Ok ( ( ) )
427- }
428-
429395 fn dup ( & mut self , old_fd : i32 ) -> InterpResult < ' tcx , Scalar > {
430396 let this = self . eval_context_mut ( ) ;
431397
0 commit comments