Skip to content

Commit

Permalink
feat: msync NonNull
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanWoollett-Light committed Nov 12, 2023
1 parent df604d2 commit a95f5b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changelog/2000.changed.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
`mmap`, `mmap_anonymous`, `munmap`, `mremap` and `madvise` updated to use `NonNull`.
`mmap`, `mmap_anonymous`, `munmap`, `mremap`, `madvise` and `msync` updated to use `NonNull`.
4 changes: 2 additions & 2 deletions src/sys/mman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<c_void>,
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"))]
Expand Down

0 comments on commit a95f5b3

Please sign in to comment.