Rollup merge of #128259 - sunshowers:msg-nosignal, r=Mark-Simulacrum
[illumos/solaris] set MSG_NOSIGNAL while writing to sockets Both these platforms have MSG_NOSIGNAL available, and we should set it for socket writes in the event that the SIGPIPE handler has been reset to SIG_DFL (i.e. terminate the process). I've verified via a quick program at https://github.com/sunshowers/msg-nosignal-test/ that even when the SIGPIPE handler is reset to SIG_DFL, writes to closed TCP sockets now error out with EPIPE. (Under ordinary circumstances UDP writes won't cause MSG_NOSIGNAL.) However, I couldn't find any existing tests which verified the MSG_NOSIGNAL behavior.
This commit is contained in:
commit
2b58d8c08c
@ -20,6 +20,8 @@
|
|||||||
target_os = "freebsd",
|
target_os = "freebsd",
|
||||||
target_os = "openbsd",
|
target_os = "openbsd",
|
||||||
target_os = "netbsd",
|
target_os = "netbsd",
|
||||||
|
target_os = "solaris",
|
||||||
|
target_os = "illumos",
|
||||||
target_os = "haiku",
|
target_os = "haiku",
|
||||||
target_os = "nto",
|
target_os = "nto",
|
||||||
))]
|
))]
|
||||||
@ -31,6 +33,8 @@
|
|||||||
target_os = "freebsd",
|
target_os = "freebsd",
|
||||||
target_os = "openbsd",
|
target_os = "openbsd",
|
||||||
target_os = "netbsd",
|
target_os = "netbsd",
|
||||||
|
target_os = "solaris",
|
||||||
|
target_os = "illumos",
|
||||||
target_os = "haiku",
|
target_os = "haiku",
|
||||||
target_os = "nto",
|
target_os = "nto",
|
||||||
)))]
|
)))]
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
target_os = "hurd",
|
target_os = "hurd",
|
||||||
target_os = "dragonfly", target_os = "freebsd",
|
target_os = "dragonfly", target_os = "freebsd",
|
||||||
target_os = "openbsd", target_os = "netbsd",
|
target_os = "openbsd", target_os = "netbsd",
|
||||||
|
target_os = "solaris", target_os = "illumos",
|
||||||
target_os = "haiku", target_os = "nto"))] {
|
target_os = "haiku", target_os = "nto"))] {
|
||||||
use libc::MSG_NOSIGNAL;
|
use libc::MSG_NOSIGNAL;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user