[Nut-upsdev] MSG_NOSIGNAL does not exist in OS X

Charles Lepple clepple at gmail.com
Mon Feb 11 07:00:13 UTC 2008

On Feb 10, 2008 3:06 PM, Arjen de Korte <nut+devel at de-korte.org> wrote:
> > I'm seeing an error with the XML/HTTP driver in NUT:
> [...]
> > What is the side effect of not using MSG_NOSIGNAL? I could just
> > #define it to 0, but I don't know if this would cause any problems.
> The MSG_NOSIGNAL prevents send() from sending the SIGPIPE signal in case
> the connection is broken and instead it will only return errno EPIPE. In
> NUT drivers, there is no difference, since we ignore this signal (through
> setup_signals() in 'main.c') anyway.

Heh, I was hoping Arnaud could tell us something more than what the
man page says :-)

I guess I was thinking that it was probably added for a reason, and I
was really trying to find out if that reason was something more than
"because it was in some older code".

> Since MSG_NOSIGNAL is not POSIX compliant, it should not be used. I've
> volunteered to work on this, so this will be fixed when the 'libtcp' (I'm
> open to suggestions for better names) I'm working on is ready. It will
> have a similar interface as the ser_* functions we already have in
> 'serial.c' (now you also know where my recent changes originate from).

Well, as a short-term fix, I think we can test for it and #define it
to 0. I don't know the timeline for libtcp, but if Arnaud wants to
push the XML/HTTP driver into Testing soon, then the #define would be
a good short-term fix (assuming that it really wouldn't be needed on
OS X).

- Charles Lepple

More information about the Nut-upsdev mailing list