Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain

From: Bryan Green <dbryan(dot)green(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain
Date: 2025-11-12 01:02:14
Message-ID: 7412f694-7c57-41e5-ae37-71136070b0da@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/7/2025 11:28 AM, Bryan Green wrote:
> On 11/6/2025 8:42 AM, Bryan Green wrote:
>> On 11/6/2025 7:43 AM, Thomas Munro wrote:
...
>> So the plan would be:
>>
>> Backport branches (v16+):
>> #define O_DIRECT 0x80000000
>> #define O_CLOEXEC 0x04000000
>> #define O_DSYNC _O_NO_INHERIT
>>
>> Master:
>> #define O_DIRECT 0x80000000
>> #define O_DSYNC 0x04000000
>> #define O_CLOEXEC _O_NO_INHERIT
>>
>> And then in pgwin32_open():
>> sa.bInheritHandle = (fileFlags & O_CLOEXEC) ? FALSE : TRUE;
>>
>> I will prepare a new version of the patch that implements the suggested
>> change for master.
>>
>>
> The changes for master, along with a tap test, are provided with the
> attached patch.
>

Thanks to CI discovered a mistake in the makefile and meson.build file
for the tests. New patch attached.
--
Bryan Green
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
v3-0001-Fix-O_CLOEXEC-flag-handling-in-Windows-port.patch text/plain 15.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-11-12 01:09:52 Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions
Previous Message Robert Treat 2025-11-11 23:22:36 Re: another autovacuum scheduling thread