]> git.proxmox.com Git - rustc.git/blobdiff - library/std/src/sys/sgx/fd.rs
Merge 1.70 into proxmox/bookworm
[rustc.git] / library / std / src / sys / sgx / fd.rs
index e5dc5b5adaa934a0ed34de571c425e2e231275da..0c02a107691c89fe2fea710c313b0696f2814c87 100644 (file)
@@ -1,7 +1,7 @@
 use fortanix_sgx_abi::Fd;
 
 use super::abi::usercalls;
-use crate::io::{self, IoSlice, IoSliceMut};
+use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
 use crate::mem;
 use crate::sys::{AsInner, FromInner, IntoInner};
 
@@ -30,6 +30,10 @@ impl FileDesc {
         usercalls::read(self.fd, &mut [IoSliceMut::new(buf)])
     }
 
+    pub fn read_buf(&self, buf: BorrowedCursor<'_>) -> io::Result<()> {
+        crate::io::default_read_buf(|b| self.read(b), buf)
+    }
+
     pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         usercalls::read(self.fd, bufs)
     }