pub unsafe fn copy(
        &self,
        src: *const c_void,
        dst: *mut c_void,
        len: usize,
        wake: bool,
    ) -> Result<usize> {
        let mut copy = raw::uffdio_copy {
            src: src as u64,
            dst: dst as u64,
            len: len as u64,
            mode: if wake {
                0
            } else {
                raw::UFFDIO_COPY_MODE_DONTWAKE
            },
            copy: 0,
        };

        let _ = raw::copy(self.as_raw_fd(), &mut copy as *mut raw::uffdio_copy)
            .map_err(Error::CopyFailed)?;
        if copy.copy < 0 {
            // shouldn't ever get here, as errno should be caught above
            Err(Error::CopyFailed(Errno::from_i32(-copy.copy as i32)))
        } else {
            Ok(copy.copy as usize)
        }
    }
/// Atomically copy a continuous memory chunk into the userfaultfd-registered range, and return
/// the number of bytes that were successfully copied.
///
/// If `wake` is `true`, wake up the thread waiting for page fault resolution on the memory
/// range.
Atomically copy a continuous memory chunk into the userfaultfd-registered range, and return
the number of bytes that were successfully copied.

If `wake` is `true`, wake up the thread waiting for page fault resolution on the memory
range.
Atomically copy a continuous memory chunk into the userfaultfd - registered range and return the number of bytes that were successfully copied . If ` wake ` is ` true ` wake up the thread waiting for page fault resolution on the memory range .
pub unsafe fn copy(
        &self,
        src: *const c_void,
        dst: *mut c_void,
        len: usize,
        wake: bool,
    ) -> Result<usize> {
        let mut copy = raw::uffdio_copy {
            src: src as u64,
            dst: dst as u64,
            len: len as u64,
            mode: if wake {
                0
            } else {
                raw::UFFDIO_COPY_MODE_DONTWAKE
            },
            copy: 0,
        };
        let _ = raw::copy(self.as_raw_fd(), &mut copy as *mut raw::uffdio_copy)
            .map_err(Error::CopyFailed)?;
        if copy.copy < 0 {
            // shouldn't ever get here, as errno should be caught above
            Err(Error::CopyFailed(Errno::from_i32(-copy.copy as i32)))
        } else {
            Ok(copy.copy as usize)
        }
    }
pub unsafe fn copy ( & self , src : * const c_void , dst : * mut c_void , len : usize , wake : bool , ) -> Result < usize > { let mut copy = raw :: uffdio_copy { src : src as u64 , dst : dst as u64 , len : len as u64 , mode : if wake { 0 } else { raw :: UFFDIO_COPY_MODE_DONTWAKE } , copy : 0 , } ; let _ = raw :: copy ( self . as_raw_fd ( ) , & mut copy as * mut raw :: uffdio_copy ) . map_err ( Error :: CopyFailed ) ? ; if copy . copy < 0 { // shouldn't ever get here, as errno should be caught above Err ( Error :: CopyFailed ( Errno :: from_i32 ( - copy . copy as i32 ) ) ) } else { Ok ( copy . copy as usize ) } }
Atomically copy a continuous memory chunk into the userfaultfd-registered range, and return
the number of bytes that were successfully copied.
Atomically copy a continuous memory chunk into the userfaultfd - registered range and return the number of bytes that were successfully copied .
&self
src
*const c_void
dst
*mut c_void
len
usize
wake
bool