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

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix fseek() detection of unseekable files on WIN32
Date: 2023-03-19 19:10:10
Message-ID: CAC+AXB0042dK+xWTZqsmm47fB+tRcCOp-M37R31+Budv-gqefA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 19, 2023 at 12:45 PM Michael Paquier <michael(at)paquier(dot)xyz>
wrote:

>
> In short, I was thinking among the lines of something like the
> attached, where I have invented a pgwin32_get_file_type() that acts as
> a wrapper of GetFileType() in a new file called win32common.c, with
> all the error handling we would use between fstat(), fseeko() and
> ftello() centralized in a single code path.
>
> The refactoring with win32common.c had better be separated into its
> own patch, at the end, if using an approach like that.
>

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?

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.

Regards,

Juan José Santamaría Flecha

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2023-03-19 19:31:51 Re: Memory leak from ExecutorState context?
Previous Message Tom Lane 2023-03-19 18:22:10 Re: Extending outfuncs support to utility statements