Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix posix.sendfile
  • Loading branch information
youknowone committed Jan 23, 2026
commit 1e3aad2b7213e08ed4356222a2aad00688fcdb0d
9 changes: 8 additions & 1 deletion crates/vm/src/stdlib/posix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,14 @@ pub mod module {
headers,
trailers,
);
res.map_err(|err| err.into_pyexception(vm))?;
// On macOS, sendfile can return EAGAIN even when some bytes were written.
// In that case, we should return the number of bytes written rather than
// raising an exception. Only raise an error if no bytes were written.
if let Err(err) = res
&& written == 0
{
return Err(err.into_pyexception(vm));
}
Ok(vm.ctx.new_int(written as u64).into())
}

Expand Down