Re: [RFC,PATCH] SIGPIPE masking in local socket connections - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [RFC,PATCH] SIGPIPE masking in local socket connections
Date
Msg-id 12064.1243953917@sss.pgh.pa.us
Whole thread Raw
In response to Re: [RFC,PATCH] SIGPIPE masking in local socket connections  (Jeremy Kerr <jk@ozlabs.org>)
Responses [PATCH 2/2] [libpq] Try to avoid manually masking SIGPIPEs on every send()  (Jeremy Kerr <jk@ozlabs.org>)
[PATCH 1/2] [libpq] rework sigpipe-handling macros  (Jeremy Kerr <jk@ozlabs.org>)
[PATCH 0/2] SIGPIPE masking in local socket connections, v2  (Jeremy Kerr <jk@ozlabs.org>)
List pgsql-hackers
Jeremy Kerr <jk@ozlabs.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


pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: [RFC,PATCH] SIGPIPE masking in local socket connections
Next
From: Aidan Van Dyk
Date:
Subject: Re: PostgreSQL Developer meeting minutes up