Re: [PATCH v4 3/6] core.fsyncobjectfiles: add windows support for batch mode
- From
- Neeraj Singh <nksingh85@gmail.com>
- Date
- Sep 22, 2021, 01:23 UTC
- Message-ID
- <CANQDOddiQHsVOwdCgW_r13FD5zaBwo1JJ+FbEip-F6AAcCdnMQ@mail.gmail.com>
- In-Reply-To
- <87ilyt8per.fsf@evledraar.gmail.com>
On Tue, Sep 21, 2021 at 4:44 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 25 quoted lines
>
>
> On Mon, Sep 20 2021, Neeraj Singh via GitGitGadget wrote:
>
> > +int win32_fsync_no_flush(int fd)
> > +{
> > + IO_STATUS_BLOCK io_status;
> > +
> > +#define FLUSH_FLAGS_FILE_DATA_ONLY 1
> > +
> > + DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NtFlushBuffersFileEx,
> > + HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize,
> > + PIO_STATUS_BLOCK IoStatusBlock);
> > +
> > + if (!INIT_PROC_ADDR(NtFlushBuffersFileEx)) {
> > + errno = ENOSYS;
> > + return -1;
> > + }
> > +
> > + /* See https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntflushbuffersfileex */
> > + memset(&io_status, 0, sizeof(io_status));
>
> See just an informative link to the API docs, or is the comemnt on the
> memset() in particular. This comment seems like it's just doing a
> Google/Bing search for you, so maybe better without it?Will remove. Just wanted to make sure everyone knows taht this is documented somewhere :).