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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Bryan Green <dbryan.green@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-12-22T21:50:38Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. ci: Test Windows + Mkvcbuild.pm in REL_16_STABLE.

  2. Fix Mkvcbuild.pm builds of test_cloexec.c.

  3. Clean up test_cloexec.c and Makefile.

  4. Fix O_CLOEXEC flag handling in Windows port.

  5. Don't leak descriptors into subprograms.

Thomas Munro <thomas.munro@gmail.com> writes:
> That revealed another problem: Mkvcbuild.pm didn't add -lpgport.  It
> looks out for the pattern PG_LIBS_INTERNAL = $(libpq_pgport), so
> that's an easy way to fix that -- is there a better way?  I couldn't
> figure out how to tell it that we need libpqport but not libpq.

AFAICT from looking at v16 Mkvcbuild.pm, PG_LIBS_INTERNAL = $(libpq_pgport)
will do exactly what you want because that only triggers it to add
libpgport and libpgcommon (cf. lines 1053ff).  I'm a little baffled
by that --- shouldn't it be pulling in libpq as well?  But let's let
sleeping dogs lie.

			regards, tom lane