Skip to content
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

Merged
merged 3 commits into from
Oct 1, 2016
Merged

Conversation

kali
Copy link
Contributor

@kali kali commented Sep 29, 2016

I'm not sure what happened when I pushed a rebased branch on #36426 , github closed it...

@rust-highfive
Copy link
Collaborator

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.

@kali
Copy link
Contributor Author

kali commented Sep 29, 2016

ping @alexcrichton just in case :)

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 29, 2016

📌 Commit 5980d5b has been approved by alexcrichton

@@ -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;
Copy link
Member

@nagisa nagisa Sep 29, 2016

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • FreeBSD SO_NOSIGPIPE = 0x0800

Copy link
Contributor Author

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.

Copy link
Member

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.

@alexcrichton
Copy link
Member

@nagisa, @kali yeah we can expand the platform support here, but that needs to start in liblibc, so it's fine to defer that to a future PR.

(this is how non-tier-1 platforms work)

@bors
Copy link
Contributor

bors commented Oct 1, 2016

⌛ Testing commit 5980d5b with merge 5045d4e...

bors added a commit that referenced this pull request Oct 1, 2016
SO_NOSIGPIPE and MSG_NOSIGNAL (rebased #36426)

I'm not sure what happened when I pushed a rebased branch on #36426 , github closed it...
@bors bors merged commit 5980d5b into rust-lang:master Oct 1, 2016
bors added a commit to rust-lang/libc that referenced this pull request Oct 8, 2016
bors added a commit that referenced this pull request Oct 9, 2016
use MSG_NOSIGNAL on all relevant platforms

followup #36824
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants