@@ -28,8 +28,8 @@ pub trait FileDescription: std::fmt::Debug + Any {
2828 /// Reads as much as possible into the given buffer, and returns the number of bytes read.
2929 fn read < ' tcx > (
3030 & self ,
31+ _self_ref : & FileDescriptionRef ,
3132 _communicate_allowed : bool ,
32- _fd_id : FdId ,
3333 _bytes : & mut [ u8 ] ,
3434 _ecx : & mut MiriInterpCx < ' tcx > ,
3535 ) -> InterpResult < ' tcx , io:: Result < usize > > {
@@ -39,8 +39,8 @@ pub trait FileDescription: std::fmt::Debug + Any {
3939 /// Writes as much as possible from the given buffer, and returns the number of bytes written.
4040 fn write < ' tcx > (
4141 & self ,
42+ _self_ref : & FileDescriptionRef ,
4243 _communicate_allowed : bool ,
43- _fd_id : FdId ,
4444 _bytes : & [ u8 ] ,
4545 _ecx : & mut MiriInterpCx < ' tcx > ,
4646 ) -> InterpResult < ' tcx , io:: Result < usize > > {
@@ -123,8 +123,8 @@ impl FileDescription for io::Stdin {
123123
124124 fn read < ' tcx > (
125125 & self ,
126+ _self_ref : & FileDescriptionRef ,
126127 communicate_allowed : bool ,
127- _fd_id : FdId ,
128128 bytes : & mut [ u8 ] ,
129129 _ecx : & mut MiriInterpCx < ' tcx > ,
130130 ) -> InterpResult < ' tcx , io:: Result < usize > > {
@@ -147,8 +147,8 @@ impl FileDescription for io::Stdout {
147147
148148 fn write < ' tcx > (
149149 & self ,
150+ _self_ref : & FileDescriptionRef ,
150151 _communicate_allowed : bool ,
151- _fd_id : FdId ,
152152 bytes : & [ u8 ] ,
153153 _ecx : & mut MiriInterpCx < ' tcx > ,
154154 ) -> InterpResult < ' tcx , io:: Result < usize > > {
@@ -176,8 +176,8 @@ impl FileDescription for io::Stderr {
176176
177177 fn write < ' tcx > (
178178 & self ,
179+ _self_ref : & FileDescriptionRef ,
179180 _communicate_allowed : bool ,
180- _fd_id : FdId ,
181181 bytes : & [ u8 ] ,
182182 _ecx : & mut MiriInterpCx < ' tcx > ,
183183 ) -> InterpResult < ' tcx , io:: Result < usize > > {
@@ -202,8 +202,8 @@ impl FileDescription for NullOutput {
202202
203203 fn write < ' tcx > (
204204 & self ,
205+ _self_ref : & FileDescriptionRef ,
205206 _communicate_allowed : bool ,
206- _fd_id : FdId ,
207207 bytes : & [ u8 ] ,
208208 _ecx : & mut MiriInterpCx < ' tcx > ,
209209 ) -> InterpResult < ' tcx , io:: Result < usize > > {
@@ -261,16 +261,6 @@ impl FileDescriptionRef {
261261 pub fn get_id ( & self ) -> FdId {
262262 self . 0 . id
263263 }
264-
265- /// Function used to retrieve the readiness events of a file description and insert
266- /// an `EpollEventInstance` into the ready list if the file description is ready.
267- pub ( crate ) fn check_and_update_readiness < ' tcx > (
268- & self ,
269- ecx : & mut InterpCx < ' tcx , MiriMachine < ' tcx > > ,
270- ) -> InterpResult < ' tcx , ( ) > {
271- use crate :: shims:: unix:: linux:: epoll:: EvalContextExt ;
272- ecx. check_and_update_readiness ( self . get_id ( ) , || self . get_epoll_ready_events ( ) )
273- }
274264}
275265
276266/// Holds a weak reference to the actual file description.
@@ -567,7 +557,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
567557 // `usize::MAX` because it is bounded by the host's `isize`.
568558 let mut bytes = vec ! [ 0 ; usize :: try_from( count) . unwrap( ) ] ;
569559 let result = match offset {
570- None => fd. read ( communicate , fd . get_id ( ) , & mut bytes, this) ,
560+ None => fd. read ( & fd , communicate , & mut bytes, this) ,
571561 Some ( offset) => {
572562 let Ok ( offset) = u64:: try_from ( offset) else {
573563 let einval = this. eval_libc ( "EINVAL" ) ;
@@ -625,7 +615,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
625615 } ;
626616
627617 let result = match offset {
628- None => fd. write ( communicate , fd . get_id ( ) , & bytes, this) ,
618+ None => fd. write ( & fd , communicate , & bytes, this) ,
629619 Some ( offset) => {
630620 let Ok ( offset) = u64:: try_from ( offset) else {
631621 let einval = this. eval_libc ( "EINVAL" ) ;
0 commit comments