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

Redox Cross Compilation #38401

Merged
merged 28 commits into from
Dec 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
341d2d1
Add redox target
jackpot51 Dec 13, 2016
c7aa284
Fix typo
jackpot51 Dec 13, 2016
a621d12
Fix issue with setting cfg(unix)
jackpot51 Dec 13, 2016
d2707aa
Use panic abort by default
jackpot51 Dec 13, 2016
ece703a
Add Redox make config
jackpot51 Dec 13, 2016
f86e014
Use alloc_system as default allocation crate
jackpot51 Dec 14, 2016
3e7543a
WIP: Cross-compilation for Redox target
jackpot51 Dec 15, 2016
773a0a2
Add start functions, switch allocation crate to ralloc
jackpot51 Dec 15, 2016
07e313d
Add openlibm to redox
jackpot51 Dec 15, 2016
6d7c2ec
Revert libstd/Cargo.toml to master
jackpot51 Dec 15, 2016
57bc1a9
Add arm syscalls
jackpot51 Dec 20, 2016
86f85c1
Move start functions into libstd/rt
jackpot51 Dec 20, 2016
01157e6
Link openlibm only in libstd
jackpot51 Dec 20, 2016
e55596f
Move rt into sys::rt, fix tidy
jackpot51 Dec 20, 2016
65eecf8
Readd statvfs
jackpot51 Dec 20, 2016
fd4bc88
Fix building without backtrace
jackpot51 Dec 21, 2016
7697c72
Static link openlibm
jackpot51 Dec 21, 2016
2ca1f0b
Switch back to alloc_system
jackpot51 Dec 21, 2016
bf50acb
Fix tidy
jackpot51 Dec 21, 2016
e909e43
Update liblibc, go back to lazy linking openlibm
jackpot51 Dec 21, 2016
92c8e0f
Merge branch 'redox_cross' of https://github.com/redox-os/rust into r…
jackpot51 Dec 21, 2016
7d3ae87
Add RawFd traits for net
jackpot51 Dec 22, 2016
e7b006d
In order to successfully build, go back to ralloc
jackpot51 Dec 22, 2016
1eb6c44
Remove start functions, use newlib instead of openlibm + ralloc
jackpot51 Dec 22, 2016
2ddd117
Revert rt.rs
jackpot51 Dec 22, 2016
474eb62
Do not build emutls on Redox
jackpot51 Dec 23, 2016
c59bb49
Correct target_family mess
jackpot51 Dec 23, 2016
4dcb867
Convert fam to Symbol
jackpot51 Dec 23, 2016
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
1 change: 1 addition & 0 deletions mk/cfg/x86_64-unknown-redox.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# rustbuild-only target
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The old build system is complicated to use, so there is no support for using it.

3 changes: 2 additions & 1 deletion src/liballoc_jemalloc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ fn main() {
// targets, which means we have to build the alloc_jemalloc crate
// for targets like emscripten, even if we don't use it.
if target.contains("rumprun") || target.contains("bitrig") || target.contains("openbsd") ||
target.contains("msvc") || target.contains("emscripten") || target.contains("fuchsia") {
target.contains("msvc") || target.contains("emscripten") || target.contains("fuchsia") ||
target.contains("redox") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not support jemalloc, so we will build with the dummy.

println!("cargo:rustc-cfg=dummy_jemalloc");
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
issue = "27783")]
#![feature(allocator)]
#![feature(staged_api)]
#![cfg_attr(unix, feature(libc))]
#![cfg_attr(any(unix, target_os = "redox"), feature(libc))]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For alloc_system, we simply reuse the unix setup to allow a libc implementation of an allocator


// The minimum alignment guaranteed by the architecture. This value is used to
// add fast paths for low alignment values. In practice, the alignment is a
Expand Down Expand Up @@ -71,7 +71,7 @@ pub extern "C" fn __rust_usable_size(size: usize, align: usize) -> usize {
imp::usable_size(size, align)
}

#[cfg(unix)]
#[cfg(any(unix, target_os = "redox"))]
mod imp {
extern crate libc;

Expand All @@ -87,7 +87,7 @@ mod imp {
}
}

#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", target_os = "redox"))]
Copy link
Contributor Author

@jackpot51 jackpot51 Dec 22, 2016

Choose a reason for hiding this comment

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

Newlib does not contain posix_memalign, so we use memalign

unsafe fn aligned_malloc(size: usize, align: usize) -> *mut u8 {
// On android we currently target API level 9 which unfortunately
// doesn't have the `posix_memalign` API used below. Instead we use
Expand All @@ -109,7 +109,7 @@ mod imp {
libc::memalign(align as libc::size_t, size as libc::size_t) as *mut u8
}

#[cfg(not(target_os = "android"))]
#[cfg(not(any(target_os = "android", target_os = "redox")))]
unsafe fn aligned_malloc(size: usize, align: usize) -> *mut u8 {
let mut out = ptr::null_mut();
let ret = libc::posix_memalign(&mut out, align as libc::size_t, size as libc::size_t);
Expand Down
2 changes: 1 addition & 1 deletion src/libcompiler_builtins/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ fn main() {
"atomic_thread_fence.c"]);
}

if !target.contains("windows") {
if !target.contains("redox") && !target.contains("windows") {
sources.extend(&["emutls.c"]);
}

Expand Down
18 changes: 6 additions & 12 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,26 +943,20 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
let vendor = &sess.target.target.target_vendor;
let max_atomic_width = sess.target.target.max_atomic_width();

let fam = if let Some(ref fam) = sess.target.target.options.target_family {
Symbol::intern(fam)
} else if sess.target.target.options.is_like_windows {
Symbol::intern("windows")
} else {
Symbol::intern("unix")
};

let mut ret = HashSet::new();
// Target bindings.
ret.insert((Symbol::intern("target_os"), Some(Symbol::intern(os))));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the windows platforms now correctly define target_family, this is no longer necessary.

ret.insert((Symbol::intern("target_family"), Some(fam)));
if let Some(ref fam) = sess.target.target.options.target_family {
ret.insert((Symbol::intern("target_family"), Some(Symbol::intern(fam))));
if fam == "windows" || fam == "unix" {
ret.insert((Symbol::intern(fam), None));
}
}
ret.insert((Symbol::intern("target_arch"), Some(Symbol::intern(arch))));
ret.insert((Symbol::intern("target_endian"), Some(Symbol::intern(end))));
ret.insert((Symbol::intern("target_pointer_width"), Some(Symbol::intern(wordsz))));
ret.insert((Symbol::intern("target_env"), Some(Symbol::intern(env))));
ret.insert((Symbol::intern("target_vendor"), Some(Symbol::intern(vendor))));
if fam == "windows" || fam == "unix" {
ret.insert((fam, None));
}
if sess.target.target.options.has_elf_tls {
ret.insert((Symbol::intern("target_thread_local"), None));
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/apple_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub fn opts() -> TargetOptions {
function_sections: false,
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
Copy link
Contributor Author

@jackpot51 jackpot51 Dec 23, 2016

Choose a reason for hiding this comment

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

Everything that isn't windows, is set to unix. That includes Linux, OS X, iOS, DragonflyBSD, NetBSD, OpenBSD, FreeBSD, Bitrig, Solaris, Fuchsia, and Haiku

is_like_osx: true,
has_rpath: true,
dll_prefix: "lib".to_string(),
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/bitrig_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
position_independent_executables: true,
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/dragonfly_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
pre_link_args: vec![
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/freebsd_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
pre_link_args: vec![
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/fuchsia_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
pre_link_args: vec![
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/haiku_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub fn opts() -> TargetOptions {
dynamic_linking: true,
executables: true,
has_rpath: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
.. Default::default()
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/linux_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
pre_link_args: vec![
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ mod windows_base;
mod windows_msvc_base;
mod thumb_base;
mod fuchsia_base;
mod redox_base;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We must add a new OS base for Redox


pub type TargetResult = Result<Target, String>;

Expand Down Expand Up @@ -184,6 +185,8 @@ supported_targets! {
("aarch64-unknown-fuchsia", aarch64_unknown_fuchsia),
("x86_64-unknown-fuchsia", x86_64_unknown_fuchsia),

("x86_64-unknown-redox", x86_64_unknown_redox),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We support a single architecture for Redox, x86_64


("i386-apple-ios", i386_apple_ios),
("x86_64-apple-ios", x86_64_apple_ios),
("aarch64-apple-ios", aarch64_apple_ios),
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/netbsd_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
pre_link_args: vec![
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/openbsd_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
is_like_openbsd: true,
Expand Down
50 changes: 50 additions & 0 deletions src/librustc_back/target/redox_base.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use PanicStrategy;
use target::TargetOptions;
use std::default::Default;

pub fn opts() -> TargetOptions {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This target is a bit different from others. Redox does not link to a libc, and does not have a rational C cross compiler. For this reason, some things have to be added. I will explain later.

TargetOptions {
pre_link_args: vec![
// We want to be able to strip as much executable code as possible
// from the linker command line, and this flag indicates to the
// linker that it can avoid linking in dynamic libraries that don't
// actually satisfy any symbols up to that point (as with many other
// resolutions the linker does). This option only applies to all
// following libraries so we're sure to pass it as one of the first
// arguments.
"-Wl,--as-needed".to_string(),

// Always enable NX protection when it is available
"-Wl,-z,noexecstack".to_string(),

// Static link
"-static".to_string()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Redox does not support dynamic linking, so all files should be linked statically.

Copy link
Member

Choose a reason for hiding this comment

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

I believe we've recently added support for cfg(crt-static = "..."), so could you be sure to set that flag in this file as well?

],
late_link_args: vec![
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We late link libc and libm so that they can be provided when binaries are linked, rather than using the compiler defaults.

"-lc".to_string(),
"-lm".to_string()
],
executables: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are able to generate executables. This is done rather unhygienically in libstd with a _start function.

relocation_model: "static".to_string(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no support for relocation in Redox.

disable_redzone: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Red zones are not currently supported by Redox. This may be enabled in the future after testing.

eliminate_frame_pointer: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not eliminate the frame pointer so that stack frames are easily traversable.

target_family: None,
Copy link
Contributor Author

@jackpot51 jackpot51 Dec 23, 2016

Choose a reason for hiding this comment

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

Redox no longer has a family :-(

Copy link
Contributor

Choose a reason for hiding this comment

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

😢

linker_is_gnu: true,
no_default_libraries: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No default libraries must be linked, as they would come from the host.

lib_allocation_crate: "alloc_system".to_string(),
exe_allocation_crate: "alloc_system".to_string(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use alloc_system as the default allocator. I personally would like to use ralloc

has_elf_tls: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do support TLS, so we enable it.

panic_strategy: PanicStrategy::Abort,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not support unwinding, so we panic using abort

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unwinding is not supported at the moment, so we abort.

.. Default::default()
}
}
1 change: 1 addition & 0 deletions src/librustc_back/target/solaris_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub fn opts() -> TargetOptions {
dynamic_linking: true,
executables: true,
has_rpath: true,
target_family: Some("unix".to_string()),
is_like_solaris: true,
exe_allocation_crate: super::maybe_jemalloc(),

Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/windows_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub fn opts() -> TargetOptions {
staticlib_prefix: "".to_string(),
staticlib_suffix: ".lib".to_string(),
no_default_libraries: true,
target_family: Some("windows".to_string()),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both the windows bases are covered

is_like_windows: true,
allows_weak_linkage: false,
pre_link_args: vec![
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/windows_msvc_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub fn opts() -> TargetOptions {
exe_suffix: ".exe".to_string(),
staticlib_prefix: "".to_string(),
staticlib_suffix: ".lib".to_string(),
target_family: Some("windows".to_string()),
is_like_windows: true,
is_like_msvc: true,
pre_link_args: vec![
Expand Down
30 changes: 30 additions & 0 deletions src/librustc_back/target/x86_64_unknown_redox.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use target::{Target, TargetResult};

pub fn target() -> TargetResult {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These settings are very similar to those in other targets, and are nothing special.

let mut base = super::redox_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.push("-m64".to_string());

Ok(Target {
llvm_target: "x86_64-unknown-redox".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
arch: "x86_64".to_string(),
target_os: "redox".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: base,
})
}
2 changes: 1 addition & 1 deletion src/libstd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() {
let target = env::var("TARGET").expect("TARGET was not set");
let host = env::var("HOST").expect("HOST was not set");
if cfg!(feature = "backtrace") && !target.contains("apple") && !target.contains("msvc") &&
!target.contains("emscripten") && !target.contains("fuchsia") {
!target.contains("emscripten") && !target.contains("fuchsia") && !target.contains("redox") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We disable the build of libbacktrace, as it will not currently compile for Redox

build_libbacktrace(&host, &target);
}

Expand Down
35 changes: 20 additions & 15 deletions src/libstd/sys/redox/ext/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
#![stable(feature = "rust1", since = "1.0.0")]

use fs;
use net;
use sys;
use sys_common::{AsInner, FromInner, IntoInner};
use sys_common::{self, AsInner, FromInner, IntoInner};

/// Raw file descriptors.
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -89,58 +90,62 @@ impl IntoRawFd for fs::File {
}
}

/*
#[stable(feature = "rust1", since = "1.0.0")]
impl AsRawFd for net::TcpStream {
fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
fn as_raw_fd(&self) -> RawFd {
self.as_inner().as_inner().fd().raw()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl AsRawFd for net::TcpListener {
fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
fn as_raw_fd(&self) -> RawFd {
self.as_inner().as_inner().fd().raw()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl AsRawFd for net::UdpSocket {
fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
fn as_raw_fd(&self) -> RawFd {
self.as_inner().as_inner().fd().raw()
}
}

#[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawFd for net::TcpStream {
unsafe fn from_raw_fd(fd: RawFd) -> net::TcpStream {
let socket = sys::net::Socket::from_inner(fd);
net::TcpStream::from_inner(sys_common::net::TcpStream::from_inner(socket))
let file = sys::fs::File::from_inner(fd);
net::TcpStream::from_inner(sys_common::net::TcpStream::from_inner(file))
}
}
#[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawFd for net::TcpListener {
unsafe fn from_raw_fd(fd: RawFd) -> net::TcpListener {
let socket = sys::net::Socket::from_inner(fd);
net::TcpListener::from_inner(sys_common::net::TcpListener::from_inner(socket))
let file = sys::fs::File::from_inner(fd);
net::TcpListener::from_inner(sys_common::net::TcpListener::from_inner(file))
}
}
#[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawFd for net::UdpSocket {
unsafe fn from_raw_fd(fd: RawFd) -> net::UdpSocket {
let socket = sys::net::Socket::from_inner(fd);
net::UdpSocket::from_inner(sys_common::net::UdpSocket::from_inner(socket))
let file = sys::fs::File::from_inner(fd);
net::UdpSocket::from_inner(sys_common::net::UdpSocket::from_inner(file))
}
}

#[stable(feature = "into_raw_os", since = "1.4.0")]
impl IntoRawFd for net::TcpStream {
fn into_raw_fd(self) -> RawFd {
self.into_inner().into_socket().into_inner()
self.into_inner().into_inner().into_fd().into_raw()
}
}
#[stable(feature = "into_raw_os", since = "1.4.0")]
impl IntoRawFd for net::TcpListener {
fn into_raw_fd(self) -> RawFd {
self.into_inner().into_socket().into_inner()
self.into_inner().into_inner().into_fd().into_raw()
}
}
#[stable(feature = "into_raw_os", since = "1.4.0")]
impl IntoRawFd for net::UdpSocket {
fn into_raw_fd(self) -> RawFd {
self.into_inner().into_socket().into_inner()
self.into_inner().into_inner().into_fd().into_raw()
}
}
*/
Loading