MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / test_msync

Function test_msync

tests/mm/mmap.rs:155–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153
154#[test]
155fn test_msync() {
156 use rustix::mm::{mmap_anonymous, msync, munmap, MapFlags, MsyncFlags, ProtFlags};
157 use std::ptr::null_mut;
158
159 unsafe {
160 let addr = mmap_anonymous(null_mut(), 8192, ProtFlags::READ, MapFlags::PRIVATE).unwrap();
161
162 msync(addr, 8192, MsyncFlags::SYNC).unwrap();
163 msync(addr, 8192, MsyncFlags::ASYNC).unwrap();
164
165 munmap(addr, 8192).unwrap();
166 }
167}
168
169#[cfg(any(target_os = "emscripten", target_os = "linux"))]
170#[test]

Callers

nothing calls this directly

Calls 3

mmap_anonymousFunction · 0.50
msyncFunction · 0.50
munmapFunction · 0.50

Tested by

no test coverage detected