pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Unportable implementation of background worker start
Date: Fri, 21 Apr 2017 16:13:55 -0400
Message-ID: <26254.1492805635@sss.pgh.pa.us> (raw)
In-Reply-To: <30882.1492800880@sss.pgh.pa.us>
References: <20170421151941.45njrtwykn5dd476@alvherre.pgsql>
	<18193.1492793404@sss.pgh.pa.us>
	<20170421172044.zcyslu7kcu7tfrsv@alap3.anarazel.de>
	<20625.1492796967@sss.pgh.pa.us>
	<21444.1492798101@sss.pgh.pa.us>
	<20170421182124.wzd2be3zi2wqnuyg@alap3.anarazel.de>
	<30882.1492800880@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Tom Lane <tgl@sss.pgh.pa.us> writes:
> Andres Freund <andres@anarazel.de> writes:
>> On 2017-04-21 14:08:21 -0400, Tom Lane wrote:
>>> but I see that SUSv2
>>> mandates that fcntl.h provide both F_SETFD and FD_CLOEXEC, so by our own
>>> coding rules it ought to be okay to assume they're there.  I'm tempted to
>>> rip out the quoted bit, as well as the #ifdef F_SETFD, from libpq and see
>>> if anything in the buildfarm complains.

>> +1

> Done, we'll soon see what happens.

Should have seen this coming, I guess: some of the Windows critters are
falling over, apparently because they lack fcntl() altogether.  So the
#ifdef F_SETFD was really acting as a proxy for "#ifdef HAVE_FCNTL".

There's no HAVE_FCNTL test in configure ATM, and I'm thinking it would
be pretty silly to add one, since surely it would succeed on anything
Unix-y enough to run the configure script.

I'm guessing the best thing to do is put back #ifdef F_SETFD;
alternatively we might spell it like "#ifndef WIN32", but I'm unsure
if that'd do what we want on Cygwin or MinGW.

In non-Windows code paths in latch.c, we probably wouldn't need to
bother with #ifdef F_SETFD.

Hopefully we can leave in the removal of "#define FD_CLOEXEC".
Will wait a bit longer for more results.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (52+ messages)  latest in thread

Message-ID: <26254.1492805635@sss.pgh.pa.us>
Permalink:  ../26254.1492805635@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26254.1492805635@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, alvherre@2ndquadrant.com
  Subject: Re: Unportable implementation of background worker start
  In-Reply-To: <26254.1492805635@sss.pgh.pa.us>
  References: <20170421151941.45njrtwykn5dd476@alvherre.pgsql> <18193.1492793404@sss.pgh.pa.us> <20170421172044.zcyslu7kcu7tfrsv@alap3.anarazel.de> <20625.1492796967@sss.pgh.pa.us> <21444.1492798101@sss.pgh.pa.us> <20170421182124.wzd2be3zi2wqnuyg@alap3.anarazel.de> <30882.1492800880@sss.pgh.pa.us> <26254.1492805635@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox