Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/compat/win32/flush.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / compat / win32 / flush.c` 30 lines ยท 730 bytes Raw Blame History 1 #include "git-compat-util.h" 2 #include 3 #include "lazyload.h" 4 5 int win32_fsync_no_flush(int fd) 6 { 7 IO_STATUS_BLOCK io_status; 8 9 #ifndef FLUSH_FLAGS_FILE_DATA_ONLY 10 #define FLUSH_FLAGS_FILE_DATA_ONLY 1 11 #endif 12 13 DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NTAPI, NtFlushBuffersFileEx, 14 HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize, 15 PIO_STATUS_BLOCK IoStatusBlock); 16 17 if (!INIT_PROC_ADDR(NtFlushBuffersFileEx)) { 18 errno = ENOSYS; 19 return -1; 20 } 21 22 memset(&io_status, 0, sizeof(io_status)); 23 if (NtFlushBuffersFileEx((HANDLE)_get_osfhandle(fd), FLUSH_FLAGS_FILE_DATA_ONLY, 24 NULL, 0, &io_status)) { 25 errno = EINVAL; 26 return -1; 27 } 28 29 return 0; 30 }