Write more memory mapping tests

Microsoft claims to support COW but it's probably not true.
This commit is contained in:
Justine Tunney 2021-02-04 18:24:33 -08:00
parent 74d48f7cb6
commit 2fdc19e7a7
6 changed files with 83 additions and 29 deletions

View file

@ -28,14 +28,14 @@
* bypassed by calling this function. However the caller is responsible
* for passing the magic memory handle on Windows NT to CloseHandle().
*/
noasan struct DirectMap __mmap(void *addr, size_t size, unsigned prot,
unsigned flags, int fd, int64_t off) {
noasan struct DirectMap __mmap(void *addr, size_t size, int prot, int flags,
int fd, int64_t off) {
if (!IsWindows()) {
return (struct DirectMap){sys_mmap(addr, size, prot, flags, fd, off),
kNtInvalidHandleValue};
} else {
return __sys_mmap_nt(addr, size, prot,
fd != -1 ? g_fds.p[fd].handle : kNtInvalidHandleValue,
off);
return sys_mmap_nt(addr, size, prot, flags,
fd != -1 ? g_fds.p[fd].handle : kNtInvalidHandleValue,
off);
}
}