1 #include "git-compat-util.h"
5 int win32_fsync_no_flush(int fd
)
7 IO_STATUS_BLOCK io_status
;
9 #define FLUSH_FLAGS_FILE_DATA_ONLY 1
11 DECLARE_PROC_ADDR(ntdll
.dll
, NTSTATUS
, NTAPI
, NtFlushBuffersFileEx
,
12 HANDLE FileHandle
, ULONG Flags
, PVOID Parameters
, ULONG ParameterSize
,
13 PIO_STATUS_BLOCK IoStatusBlock
);
15 if (!INIT_PROC_ADDR(NtFlushBuffersFileEx
)) {
20 memset(&io_status
, 0, sizeof(io_status
));
21 if (NtFlushBuffersFileEx((HANDLE
)_get_osfhandle(fd
), FLUSH_FLAGS_FILE_DATA_ONLY
,
22 NULL
, 0, &io_status
)) {