Wake threads waiting on a fault in the given range without copying data. Needed after UFFDIO_COPY returns EEXIST: the page was already resolved by a concurrent fault, but any additional threads blocked on that page may not have been woken.
(fd: BorrowedFd<'_>, addr: u64, len: u64)
| 185 | /// by a concurrent fault, but any additional threads blocked on that page |
| 186 | /// may not have been woken. |
| 187 | pub(crate) fn wake(fd: BorrowedFd<'_>, addr: u64, len: u64) -> Result<(), Error> { |
| 188 | let mut range = UffdioRange { start: addr, len }; |
| 189 | // SAFETY: `range` is a valid, correctly-sized struct for this ioctl. |
| 190 | let ret = unsafe { |
| 191 | libc::ioctl( |
| 192 | fd.as_raw_fd(), |
| 193 | userfaultfd::UFFDIO_WAKE as libc::Ioctl, |
| 194 | &mut range, |
| 195 | ) |
| 196 | }; |
| 197 | if ret < 0 { |
| 198 | return Err(Error::last_os_error()); |
| 199 | } |
| 200 | Ok(()) |
| 201 | } |
no test coverage detected