[Mono-list] Status of MSG_NOSIGNAL

Jaroslaw Kowalski jarek@atm.com.pl
Fri, 7 Jun 2002 10:53:08 +0200 (CEST)

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.

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 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. Ignoring the signal would
solve all the problems, I think.

Awaiting your comments,