Re: [RFC,PATCH] SIGPIPE masking in local socket connections

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeremy Kerr <jk(at)ozlabs(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: [RFC,PATCH] SIGPIPE masking in local socket connections
Date: 2009-06-02 14:45:17
Message-ID: 12064.1243953917@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeremy Kerr <jk(at)ozlabs(dot)org> writes:
>> MSG_NOSIGNAL is a recv() flag, no?

> It's a flag to send().

Doh, need more caffeine.

>> 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.

> Yep, a once-off test would be better. However, I don't seem to have a
> NOSIGPIPE sockopt here :(

On OS X I see SO_NOSIGPIPE but not MSG_NOSIGNAL. Seems like we might
have to support both if we want this to work as widely as possible.

The SUS man page for send() does explicitly specify an error code for
unrecognized flags bits, so maybe it's safe to assume that we'll get
an error if we set MSG_NOSIGNAL but the kernel doesn't recognize it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aidan Van Dyk 2009-06-02 14:50:00 Re: PostgreSQL Developer meeting minutes up
Previous Message Marko Kreen 2009-06-02 14:43:36 Re: [RFC,PATCH] SIGPIPE masking in local socket connections