From a092c5ccc7c613b8149e98f85d0179ba01c73445 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Sun, 6 Mar 2022 02:19:59 -0600 Subject: Add MsgFlag::MSG_NOSIGNAL --- CHANGELOG.md | 2 ++ src/sys/socket/mod.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c474b2fb..98550b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). (#[1665](https://github.com/nix-rust/nix/pull/1665)) - Implemented `Read` and `Write` for `&PtyMaster` (#[1664](https://github.com/nix-rust/nix/pull/1664)) +- Added `MSG_NOSIGNAL` for Android, Dragonfly, FreeBSD, Fuchsia, Haiku, Illumos, Linux, NetBSD, OpenBSD and Solaris. + (#[1670](https://github.com/nix-rust/nix/pull/1670)) ### Changed diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 54327951..9c37e43b 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -316,6 +316,20 @@ libc_bitflags!{ target_os = "openbsd"))] #[cfg_attr(docsrs, doc(cfg(all())))] MSG_CMSG_CLOEXEC; + /// Requests not to send `SIGPIPE` errors when the other end breaks the connection. + /// (For more details, see [send(2)](https://linux.die.net/man/2/send)). + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MSG_NOSIGNAL; } } -- cgit v1.2.3