Re: Fix fseek() detection of unseekable files on WIN32

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2023-03-19T22:06:22Z
Lists: pgsql-hackers
On Sun, Mar 19, 2023 at 08:10:10PM +0100, Juan José Santamaría Flecha wrote:
> My approach was trying to make something minimal so it could be
> backpatchable. This looks fine for HEAD, but are you planning on something
> similar for the other branches?

Yes.  This is actually not invasive down to 14 as the code is
consistent for these branches.

> Doesn't pgwin32_get_file_type() fit in dirmod.c? Might be a question of
> personal taste, I don't really have strong feelings against win32common.c.

Not sure about this one.  I have considered it and dirmod.c includes
also bits for cygwin, while being aimed for higher-level routines like
rename(), unlink() or symlink().  This patch is only for WIN32, and
aimed for common parts in win32*.c code, so a separate file seemed a
bit cleaner to me at the end.
--
Michael

Commits

  1. Fix detection of unseekable files for fseek() and ftello() with MSVC