Re: Incorrect fd handling in syslogger.c for Win64 under EXEC_BACKEND

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Incorrect fd handling in syslogger.c for Win64 under EXEC_BACKEND
Date: 2021-09-28 22:25:38
Message-ID: YVOWYkB3V25UEH87@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 28, 2021 at 02:36:52PM +0900, Michael Paquier wrote:
> I wrote that a bit too quickly. After looking at it, what we could
> use to parse the handle pointer is scanint8() instead, even if that's
> a bit ugly. I also found the code a bit confused regarding "fd", that
> could be manipulated as an int or intptr_t, so something like the
> attached should improve the situation.

As reminded by Jacob, the code is corrently correct as handles are
4 bytes on both Win32 and Win64:
https://docs.microsoft.com/en-us/windows/win32/winauto/32-bit-and-64-bit-interoperability

Sorry for the noise. It looks like I got confused by intptr_t :p
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-09-28 22:27:54 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Tom Lane 2021-09-28 22:17:08 Some thoughts about the TAP tests' wait_for_catchup()