diff options
author | Rui Paulo <rpaulo@FreeBSD.org> | 2015-10-14 04:30:17 +0000 |
---|---|---|
committer | Rui Paulo <rpaulo@FreeBSD.org> | 2015-10-14 04:30:17 +0000 |
commit | b834757ea3bcd1bba3381ff7cab216458d8f7efb (patch) | |
tree | dadb24e00f30aa959ea0981e649b18c668304498 /src/utils/os_win32.c | |
parent | fbffd80fb2ba16c68f799da68a119d5e69643604 (diff) |
Diffstat (limited to 'src/utils/os_win32.c')
-rw-r--r-- | src/utils/os_win32.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils/os_win32.c b/src/utils/os_win32.c index 296ea13f153b4..dea27b9f2ad84 100644 --- a/src/utils/os_win32.c +++ b/src/utils/os_win32.c @@ -216,6 +216,24 @@ char * os_readfile(const char *name, size_t *len) } +int os_fdatasync(FILE *stream) +{ + HANDLE h; + + if (stream == NULL) + return -1; + + h = (HANDLE) _get_osfhandle(_fileno(stream)); + if (h == INVALID_HANDLE_VALUE) + return -1; + + if (!FlushFileBuffers(h)) + return -1; + + return 0; +} + + void * os_zalloc(size_t size) { return calloc(1, size); |