Re: stat() on Windows might cause error if target file is larger than 4GB

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Higuchi, Daisuke" <higuchi(dot)daisuke(at)jp(dot)fujitsu(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: stat() on Windows might cause error if target file is larger than 4GB
Date: 2018-09-11 07:08:34
Message-ID: 20180911070834.GA31650@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Higuchi-san,

On Mon, Sep 10, 2018 at 03:44:54PM +0900, Michael Paquier wrote:
> Yes, the fix needs to happen there. It seems to me that what we are
> looking for here is to complete the calculation of st_size with
> nFileSizeHigh, so as we are able to compile a correct 64-bit integer
> size, allowing support for larger files on Win32, which is something
> that fsync() support for pg_dump has actually changed by opening stat()
> to be called for files with a size larger than 4GB. (I need badly to
> setup a Windows machine...)

Does something like the patch attached help? This makes sure that
st_size is set correctly for files with a size larger than 4GB.
Unfortunately I have not been able to test it, I have tried for some
time today to deploy a Win10 VM with VS 2017 (community version), but I
cannot get past some errors because of a set of missing files when
trying to compile, the one build complains about is Platform.targets,
which goes missing even if vc_redist is installed for all the C++
deliverables. The user experience has gotten worse lately, at least for
me..
--
Michael

Attachment Content-Type Size
win32-stat-largefile.patch text/x-diff 513 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Beena Emerson 2018-09-11 08:00:46 Re: Pluggable Storage - Andres's take
Previous Message Pavel Stehule 2018-09-11 05:23:47 Re: can commitfest application resend a mail?