pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marko Kreen <markokr@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [RFC,PATCH] SIGPIPE masking in local socket connections
Date: Tue, 2 Jun 2009 17:43:36 +0300
Message-ID: <e51f66da0906020743o72237f42k28ea9832759f2676@mail.gmail.com> (raw)
In-Reply-To: <11613.1243952642@sss.pgh.pa.us>
References: <1243914753.517210.131510259224.0.gpush@pingu>
	<10549.1243949503@sss.pgh.pa.us>
	<200906022352.01814.jk@ozlabs.org>
	<11313.1243951871@sss.pgh.pa.us>
	<e51f66da0906020716y635bd2c1s49e8d91785c732bc@mail.gmail.com>
	<11613.1243952642@sss.pgh.pa.us>

On 6/2/09, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Marko Kreen <markokr@gmail.com> writes:
>  > On 6/2/09, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> >> We've had problems before with userland headers not being in sync
>  >> with what the kernel knows.
>
>  > Well, we could just test in configure perhaps?
>
>
> The single most common way to get into that kind of trouble is to
>  compile on machine A then install the executables on machine B with
>  a different kernel.  So a configure test wouldn't give me any warm
>  feeling at all.

Agreed.  Another problem would be cross-compilation.

>  A feature that is exercised via setsockopt is probably fairly safe,
>  since you can check for failure of the setsockopt call and then do
>  it the old way.  MSG_NOSIGNAL is a recv() flag, no?  The question
>  is whether you could expect that the recv() would fail if it had
>  any unrecognized flags.  Not sure if I trust that.  SO_NOSIGPIPE
>  seems safer.

send().  The question is if the kernel would give error (good)
or simply ignore it (bad).  I guess with MSG_NOSIGNAL only safe
way is to hardcode working OSes.

Are there any OS-es that have MSG_NOSIGNAL but not SO_NOSIGPIPE?

*grep*  Eh, seems like Linux is such OS...  But I also see it existing
as of Linux 2.2.0 in working state, so should be safe to use on linux
despite the kernel version.

-- 
marko



view thread (12+ messages)  latest in thread

Message-ID: <e51f66da0906020743o72237f42k28ea9832759f2676@mail.gmail.com>
Permalink:  ../e51f66da0906020743o72237f42k28ea9832759f2676@mail.gmail.com/
Also on:    postgresql.org/message-id/e51f66da0906020743o72237f42k28ea9832759f2676@mail.gmail.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: markokr@gmail.com, tgl@sss.pgh.pa.us, jk@ozlabs.org
  Subject: Re: [RFC,PATCH] SIGPIPE masking in local socket connections
  In-Reply-To: <e51f66da0906020743o72237f42k28ea9832759f2676@mail.gmail.com>

* 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