Skip to content

Vxworks / Unix deduplication #77666

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

Merged
merged 18 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Take sys/vxworks/net from sys/unix instead.
  • Loading branch information
m-ou-se committed Oct 16, 2020
commit dce405ae3dd5996a3f97f13f40f87f23261f8ccd
10 changes: 8 additions & 2 deletions library/std/src/sys/unix/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl Socket {
}
}

#[cfg(not(target_os = "vxworks"))]
pub fn new_pair(fam: c_int, ty: c_int) -> io::Result<(Socket, Socket)> {
unsafe {
let mut fds = [0, 0];
Expand All @@ -98,6 +99,11 @@ impl Socket {
}
}

#[cfg(target_os = "vxworks")]
pub fn new_pair(_fam: c_int, _ty: c_int) -> io::Result<(Socket, Socket)> {
unimplemented!()
}

pub fn connect_timeout(&self, addr: &SocketAddr, timeout: Duration) -> io::Result<()> {
self.set_nonblocking(true)?;
let r = unsafe {
Expand Down Expand Up @@ -366,7 +372,7 @@ impl IntoInner<c_int> for Socket {
// res_init unconditionally, we call it only when we detect we're linking
// against glibc version < 2.26. (That is, when we both know its needed and
// believe it's thread-safe).
#[cfg(target_env = "gnu")]
#[cfg(all(target_env = "gnu", not(target_os = "vxworks")))]
fn on_resolver_failure() {
use crate::sys;

Expand All @@ -378,5 +384,5 @@ fn on_resolver_failure() {
}
}

#[cfg(not(target_env = "gnu"))]
#[cfg(any(not(target_env = "gnu"), target_os = "vxworks"))]
fn on_resolver_failure() {}
1 change: 1 addition & 0 deletions library/std/src/sys/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub mod io;
pub mod memchr;
#[path = "../unix/mutex.rs"]
pub mod mutex;
#[path = "../unix/net.rs"]
pub mod net;
pub mod os;
pub mod path;
Expand Down
335 changes: 0 additions & 335 deletions library/std/src/sys/vxworks/net.rs

This file was deleted.

Loading