Only Linux has MSG_NOSIGNAL as a socket flag (see http://stackoverflow.com/questions/108183/how-to-prevent-sigpipes-or-handle-them-properly ) which makes compilation fail on other OSes. The BSDs and OS X have SO_NOSIGPIPE which implements the same thing but others like Solaris don't even have that (see http://stackoverflow.com/questions/2205455/detecting-broken-pipe-in-solaris-send-call )... Work around this by checking using MSG_NOSIGNAL or SO_NOSIGPIPE if available otherwise don't set anything at all so we at least continue to compile.
26 KiB
26 KiB