VFS: Call msync when syncing mapped data

This commit is contained in:
Jeffrey Pfau 2016-10-19 13:52:51 -07:00
parent 644bdec47c
commit 9756f79f04
2 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Misc:
- GBA Video: Clean up unused timers - GBA Video: Clean up unused timers
- Test: Add a basic test suite - Test: Add a basic test suite
- GBA Video: Allow multiple handles into the same tile cache - GBA Video: Allow multiple handles into the same tile cache
- VFS: Call msync when syncing mapped data
0.5.1: (2016-10-05) 0.5.1: (2016-10-05)
Bugfixes: Bugfixes:

View File

@ -167,6 +167,9 @@ static bool _vfdSync(struct VFile* vf, const void* buffer, size_t size) {
struct VFileFD* vfd = (struct VFileFD*) vf; struct VFileFD* vfd = (struct VFileFD*) vf;
#ifndef _WIN32 #ifndef _WIN32
futimes(vfd->fd, NULL); futimes(vfd->fd, NULL);
if (buffer && size) {
return msync(buffer, size, MS_SYNC) == 0;
}
return fsync(vfd->fd) == 0; return fsync(vfd->fd) == 0;
#else #else
HANDLE h = (HANDLE) _get_osfhandle(vfd->fd); HANDLE h = (HANDLE) _get_osfhandle(vfd->fd);