Re: Incorrect fd handling in syslogger.c for Win64 under EXEC_BACKEND - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Incorrect fd handling in syslogger.c for Win64 under EXEC_BACKEND
Date
Msg-id YVOWYkB3V25UEH87@paquier.xyz
Whole thread Raw
In response to Re: Incorrect fd handling in syslogger.c for Win64 under EXEC_BACKEND  (Michael Paquier <michael@paquier.xyz>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Some thoughts about the TAP tests' wait_for_catchup()
Next
From: Thomas Munro
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs