(&mut self, start: usize, buf: &[u8])
| 395 | } |
| 396 | |
| 397 | fn write(&mut self, start: usize, buf: &[u8]) -> VmResult { |
| 398 | check_access(start, buf.len())?; |
| 399 | let failed_at = access_user_memory(|| unsafe { |
| 400 | user_copy(start as _, buf.as_ptr() as *const _, buf.len()) |
| 401 | }); |
| 402 | if unlikely(failed_at != 0) { |
| 403 | Err(VmError::AccessDenied) |
| 404 | } else { |
| 405 | Ok(()) |
| 406 | } |
| 407 | } |
| 408 | } |
no test coverage detected