diff --git a/changelog/2000.changed.md b/changelog/2000.changed.md index cbc235f801..39a0bcf738 100644 --- a/changelog/2000.changed.md +++ b/changelog/2000.changed.md @@ -1 +1 @@ -`mmap`, `mmap_anonymous`, `munmap`, `mremap` and `madvise` updated to use `NonNull`. \ No newline at end of file +`mmap`, `mmap_anonymous`, `munmap`, `mremap`, `madvise` and `msync` updated to use `NonNull`. \ No newline at end of file diff --git a/src/sys/mman.rs b/src/sys/mman.rs index 841e7717db..714c4777ef 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -585,11 +585,11 @@ pub unsafe fn mprotect( /// /// [`msync(2)`]: https://man7.org/linux/man-pages/man2/msync.2.html pub unsafe fn msync( - addr: *mut c_void, + addr: NonNull, length: size_t, flags: MsFlags, ) -> Result<()> { - Errno::result(libc::msync(addr, length, flags.bits())).map(drop) + Errno::result(libc::msync(addr.as_ptr(), length, flags.bits())).map(drop) } #[cfg(not(target_os = "android"))]