vxWorks: remove all code related to UNIX socket as it is not supported by vxWorks
This commit is contained in:
parent
caa1f8d7b3
commit
8995974e70
@ -6,7 +6,8 @@ use crate::fs;
|
||||
use crate::os::raw;
|
||||
use crate::sys;
|
||||
use crate::io;
|
||||
use crate::sys_common::{AsInner, FromInner, IntoInner};
|
||||
use crate::sys_common::{self, AsInner, FromInner, IntoInner};
|
||||
use crate::net;
|
||||
|
||||
/// Raw file descriptors.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
@ -110,3 +111,61 @@ impl<'a> AsRawFd for io::StdoutLock<'a> {
|
||||
impl<'a> AsRawFd for io::StderrLock<'a> {
|
||||
fn as_raw_fd(&self) -> RawFd { libc::STDERR_FILENO }
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl AsRawFd for net::TcpStream {
|
||||
fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl AsRawFd for net::TcpListener {
|
||||
fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl AsRawFd for net::UdpSocket {
|
||||
fn as_raw_fd(&self) -> RawFd { *self.as_inner().socket().as_inner() }
|
||||
}
|
||||
|
||||
#[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))
|
||||
}
|
||||
}
|
||||
|
||||
#[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))
|
||||
}
|
||||
}
|
||||
|
||||
#[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))
|
||||
}
|
||||
}
|
||||
|
||||
#[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()
|
||||
}
|
||||
}
|
||||
#[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()
|
||||
}
|
||||
}
|
||||
#[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()
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
// Uhhh
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
#![allow(missing_docs)]
|
||||
|
||||
@ -7,7 +6,6 @@ pub mod ffi;
|
||||
pub mod fs;
|
||||
pub mod raw;
|
||||
pub mod process;
|
||||
pub mod net;
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub mod prelude {
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user