summaryrefslogtreecommitdiff
path: root/src/utils/os_win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/os_win32.c')
-rw-r--r--src/utils/os_win32.c18
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);