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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [RFC,PATCH] SIGPIPE masking in local socket connections
Дата
Msg-id 12064.1243953917@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [RFC,PATCH] SIGPIPE masking in local socket connections  (Jeremy Kerr <jk@ozlabs.org>)
Ответы [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>)
Список 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 по дате отправления:

Предыдущее
От: Marko Kreen
Дата:
Сообщение: Re: [RFC,PATCH] SIGPIPE masking in local socket connections
Следующее
От: Aidan Van Dyk
Дата:
Сообщение: Re: PostgreSQL Developer meeting minutes up