Skip to content

Commit 2265bef

Browse files
committed
Use mutable pointers for readv and preadv
1 parent 2358f56 commit 2265bef

File tree

1 file changed

+2
-2
lines changed
  • library/std/src/sys/unix

1 file changed

+2
-2
lines changed

library/std/src/sys/unix/fd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl FileDesc {
7676
let ret = cvt(unsafe {
7777
libc::readv(
7878
self.as_raw_fd(),
79-
bufs.as_ptr() as *const libc::iovec,
79+
bufs.as_mut_ptr() as *mut libc::iovec as *const libc::iovec,
8080
cmp::min(bufs.len(), max_iov()) as c_int,
8181
)
8282
})?;
@@ -132,7 +132,7 @@ impl FileDesc {
132132
let ret = cvt(unsafe {
133133
libc::preadv(
134134
self.as_raw_fd(),
135-
bufs.as_ptr() as *const libc::iovec,
135+
bufs.as_mut_ptr() as *mut libc::iovec as *const libc::iovec,
136136
cmp::min(bufs.len(), max_iov()) as c_int,
137137
offset as _,
138138
)

0 commit comments

Comments
 (0)