[Mono-list] Status of MSG_NOSIGNAL
Dick Porter
dick@ximian.com
Fri, 7 Jun 2002 10:43:44 +0100
On Fri, Jun 07, 2002 at 10:53:08AM +0200, Jaroslaw Kowalski wrote:
>
> What is the current status of using MSG_NOSIGNAL? I found the test for it
> in configure.in, there's also HAVE_MSG_NOSIGNAL define, but I find it
> rather inconsistent across the code.
Various people have promised us a patch to handle it. We're still waiting
for the full fixes, so for now we've just worked around it with a #define.
>
> As far as I know MSG_NOSIGNAL should be used to prevent some system calls
> from raising SIGPIPE signal. The alternative is to install a handler and
> simply ignore the signal by signal(SIGPIPE, SIG_IGN).
>
> In the code, there are some places where MSG_NOSIGNAL is actually used but
> there's no signal(...) call in cases where MSG_NOSIGNAL isn't supported.
>
> Is it supposed to be that way? I can prepare a patch to make it consistent
> but I'm not sure if we shouldn't just ignore SIGPIPE in all cases and
> forget using MSG_NOSIGNAL at all.
I'm not sure whether we should ignore SIGPIPE in what is essentially a
library. Temporarily disabling it on systems that dont have MSG_NOSIGNAL
should be ok though.
>
> I found at least 2 more places where using MSG_NOSIGNAL would be advised:
> sendto() and recvfrom() system calls in io-layer/sockets.c, but I'm
> unaware of other places where it is also needed.
Yes, it should probably be used there too.
- Dick