Skip to content

Commit a02e399

Browse files
tiifRalfJung
andauthored
Update src/shims/unix/fd.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent ef43a9b commit a02e399

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/shims/unix/fd.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
641641
Ok(())
642642
}
643643

644-
/// This function either writes to the user supplied buffer and to dest place, or sets the
645-
/// last libc error and writes -1 to dest.
644+
/// Helper to implement `FileDescription::read`:
645+
/// `result` should be the return value of some underlying `read` call that used `bytes` as its output buffer.
646+
/// The length of `bytes` must not exceed either the host's or the target's `isize`.
647+
/// If `Result` indicates success, `bytes` is written to `buf` and the size is written to `dest`.
648+
/// Otherwise, `-1` is written to `dest` and the last libc error is set appropriately.
646649
fn return_read_bytes_and_count(
647650
&mut self,
648651
buf: Pointer,

0 commit comments

Comments
 (0)