| 134 | } |
| 135 | |
| 136 | static inline int mprotect(void* addr, size_t len, int prot) { |
| 137 | DWORD newProtect = __map_mmap_prot_page(prot); |
| 138 | DWORD oldProtect = 0; |
| 139 | |
| 140 | if (VirtualProtect(addr, len, newProtect, &oldProtect)) return 0; |
| 141 | |
| 142 | errno = __map_mman_error(GetLastError(), EPERM); |
| 143 | |
| 144 | return -1; |
| 145 | } |
| 146 | |
| 147 | static inline int msync(void* addr, size_t len, int flags) { |
| 148 | if (FlushViewOfFile(addr, len)) return 0; |
nothing calls this directly
no test coverage detected