Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion native-io/src/main/native-io-jni/cpp/native_io_jni.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@

#ifdef _WIN32

#define fsync(fd) fflush(fd)
/* fflush requires a FILE*, but we're passing an int file descriptor.
On Windows, the correct equivalent is _commit(fd), which takes an int fd.
So, change the mapping of fsync from fflush to _commit. */
#include <io.h>
#define fsync(fd) _commit(fd)

#define strerror_r(errno,buf,len) strerror_s(buf,len,errno)

static ssize_t pread (int fd, void *buf, size_t count, off_t offset)
Expand Down