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 14:54:40 -0400
Message-ID: <30882.1492800880@sss.pgh.pa.us> (raw)
In-Reply-To: <20170421182124.wzd2be3zi2wqnuyg@alap3.anarazel.de>
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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.

In the same area, I noticed that POSIX does not say that the success
result for fcntl(F_SETFD) and related cases is 0.  It says that the
failure result is -1 and the success result is some other value.
We seem to have this right in most places, but e.g. port/noblock.c
gets it wrong.  The lack of field complaints implies that just about
everybody actually does return 0 on success, but I still think it
would be a good idea to run around and make all the calls test
specifically for -1.

			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: <30882.1492800880@sss.pgh.pa.us>
Permalink:  ../30882.1492800880@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30882.1492800880@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: <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>

* 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