Re: BUG #15858: could not stat file - over 4GB

Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>

From: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>, Emil Iggland <emil@iggland.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-10-12T12:33:32Z
Lists: pgsql-bugs, pgsql-hackers
On Mon, Oct 12, 2020 at 5:27 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Michael Paquier <michael@paquier.xyz> writes:
> > Why are we forcing errno=ENOENT here?  Wouldn't it be correct to use
> > _dosmaperr(GetLastError()) to get the correct errno?
>
> Fair question.  Juan, was there some good reason not to look at
> GetLastError() in this step?
>

Uhm, a good question indeed, forcing errno serves no purpose there.

Regards,

Juan José Santamaría Flecha

Commits

  1. Minor cleanup for win32stat.c.

  2. plperl.h should #undef fstat along with stat and lstat.

  3. Fix our Windows stat() emulation to handle file sizes > 4GB.