Skip to content

SO_NOSIGPIPE and MSG_NOSIGNAL (rebased #36426)#36824

Merged
bors merged 3 commits into
rust-lang:masterfrom
kali:master
Oct 1, 2016
Merged

SO_NOSIGPIPE and MSG_NOSIGNAL (rebased #36426)#36824
bors merged 3 commits into
rust-lang:masterfrom
kali:master

Conversation

@kali

@kali kali commented Sep 29, 2016

Copy link
Copy Markdown
Contributor

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

@rust-highfive

Copy link
Copy Markdown
Contributor

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

kali commented Sep 29, 2016

Copy link
Copy Markdown
Contributor Author

ping @alexcrichton just in case :)

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

@bors

bors commented Sep 29, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 5980d5b has been approved by alexcrichton

use sys::net::netc::IPV6_DROP_MEMBERSHIP;

#[cfg(target_os = "linux")]
use libc::MSG_NOSIGNAL;

@nagisa nagisa Sep 29, 2016

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

bors commented Oct 1, 2016

Copy link
Copy Markdown
Collaborator

⌛ 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