1 /*-------------------------------------------------------------------------
4 * Win32 fdatasync() replacement
7 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
9 * src/port/win32fdatasync.c
11 *-------------------------------------------------------------------------
15 #include "postgres_fe.h"
20 #include "port/win32ntdll.h"
29 handle
= (HANDLE
) _get_osfhandle(fd
);
30 if (handle
== INVALID_HANDLE_VALUE
)
36 if (initialize_ntdll() < 0)
39 memset(&iosb
, 0, sizeof(iosb
));
40 status
= pg_NtFlushBuffersFileEx(handle
,
41 FLUSH_FLAGS_FILE_DATA_SYNC_ONLY
,
46 if (NT_SUCCESS(status
))
49 _dosmaperr(pg_RtlNtStatusToDosError(status
));