Traditionally, the Unixes raise a SIGPIPE signal for a write failure (usually when it occurs asynchronously.) Also traditionally, this is annoying for userspace programmers which prefer to handle the error as a return code or polled error. This desired behavior may be achieved by ignoring SIGPIPE, but this signal management must be applied process-wide. Automatically apply the non-portable SO_NOSIGPIPE socket option upon socket creation, or the MSG_NOSIGNAL flag when calling sendmsg, or any platform-specific equivalent, when available. These socket options and flags. achieve the same desired behavior but on a per-socket basis and do not require process-wide signal management.