-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SO_NOSIGPIPE and MSG_NOSIGNAL (rebased #36426) #36824
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
ping @alexcrichton just in case :) |
@bors: r+ |
📌 Commit 5980d5b has been approved by |
@@ -42,6 +42,11 @@ use sys::net::netc::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP; | |||
target_os = "solaris", target_os = "haiku")))] | |||
use sys::net::netc::IPV6_DROP_MEMBERSHIP; | |||
|
|||
#[cfg(target_os = "linux")] | |||
use libc::MSG_NOSIGNAL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- DragonFlyBSD/NetBSD/OpenBSD/Bitrig:
MSG_NOSIGNAL = 0x400
; - FreeBSD
MSG_NOSIGNAL = 0x20000
; - Android
MSG_NOSIGNAL = 0x4000
; - Haiku
MSG_NOSIGNAL = 0x0800
;
Would be nice if those were included as well.
// SO_NOSIGPIPE as a setsockopt flag to disable SIGPIPE emission on socket. | ||
// Other platforms do otherwise. | ||
#[cfg(target_vendor = "apple")] | ||
use libc::SO_NOSIGPIPE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- FreeBSD
SO_NOSIGPIPE = 0x0800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Android is covered by target_os="linux", and the value is correct.
I don't have easy access to the other OS listed here. I can offer a "blind" untested patch, but I'm not really in a position to test the behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android is covered by target_os="linux",
To the best of my knowledge its not true, because value of target_os
on Android is android
, not linux
.
Blind is good enough; better than feature disparity IMO.
define more MSG_NOSIGNAL follow-up on rust-lang/rust#36824
use MSG_NOSIGNAL on all relevant platforms followup #36824
I'm not sure what happened when I pushed a rebased branch on #36426 , github closed it...