Skip to content

Commit

Permalink
Use mutable pointers for readv and preadv
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phyr committed Oct 9, 2021
1 parent 2358f56 commit 2265bef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/sys/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl FileDesc {
let ret = cvt(unsafe {
libc::readv(
self.as_raw_fd(),
bufs.as_ptr() as *const libc::iovec,
bufs.as_mut_ptr() as *mut libc::iovec as *const libc::iovec,
cmp::min(bufs.len(), max_iov()) as c_int,
)
})?;
Expand Down Expand Up @@ -132,7 +132,7 @@ impl FileDesc {
let ret = cvt(unsafe {
libc::preadv(
self.as_raw_fd(),
bufs.as_ptr() as *const libc::iovec,
bufs.as_mut_ptr() as *mut libc::iovec as *const libc::iovec,
cmp::min(bufs.len(), max_iov()) as c_int,
offset as _,
)
Expand Down

0 comments on commit 2265bef

Please sign in to comment.