mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
net: add support for Redox OS (#5790)
This commit is contained in:
parent
b7290910f7
commit
00af6eff77
@ -121,11 +121,11 @@ tracing = { version = "0.1.25", default-features = false, features = ["std"], op
|
|||||||
backtrace = { version = "0.3.58" }
|
backtrace = { version = "0.3.58" }
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
libc = { version = "0.2.42", optional = true }
|
libc = { version = "0.2.145", optional = true }
|
||||||
signal-hook-registry = { version = "1.1.1", optional = true }
|
signal-hook-registry = { version = "1.1.1", optional = true }
|
||||||
|
|
||||||
[target.'cfg(unix)'.dev-dependencies]
|
[target.'cfg(unix)'.dev-dependencies]
|
||||||
libc = { version = "0.2.42" }
|
libc = { version = "0.2.145" }
|
||||||
nix = { version = "0.26", default-features = false, features = ["fs", "socket"] }
|
nix = { version = "0.26", default-features = false, features = ["fs", "socket"] }
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies.windows-sys]
|
[target.'cfg(windows)'.dependencies.windows-sys]
|
||||||
|
@ -31,7 +31,12 @@ impl UCred {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "android", target_os = "openbsd"))]
|
#[cfg(any(
|
||||||
|
target_os = "linux",
|
||||||
|
target_os = "redox",
|
||||||
|
target_os = "android",
|
||||||
|
target_os = "openbsd"
|
||||||
|
))]
|
||||||
pub(crate) use self::impl_linux::get_peer_cred;
|
pub(crate) use self::impl_linux::get_peer_cred;
|
||||||
|
|
||||||
#[cfg(any(target_os = "netbsd"))]
|
#[cfg(any(target_os = "netbsd"))]
|
||||||
@ -49,7 +54,12 @@ pub(crate) use self::impl_solaris::get_peer_cred;
|
|||||||
#[cfg(target_os = "aix")]
|
#[cfg(target_os = "aix")]
|
||||||
pub(crate) use self::impl_aix::get_peer_cred;
|
pub(crate) use self::impl_aix::get_peer_cred;
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "android", target_os = "openbsd"))]
|
#[cfg(any(
|
||||||
|
target_os = "linux",
|
||||||
|
target_os = "redox",
|
||||||
|
target_os = "android",
|
||||||
|
target_os = "openbsd"
|
||||||
|
))]
|
||||||
pub(crate) mod impl_linux {
|
pub(crate) mod impl_linux {
|
||||||
use crate::net::unix::{self, UnixStream};
|
use crate::net::unix::{self, UnixStream};
|
||||||
|
|
||||||
@ -58,7 +68,7 @@ pub(crate) mod impl_linux {
|
|||||||
|
|
||||||
#[cfg(target_os = "openbsd")]
|
#[cfg(target_os = "openbsd")]
|
||||||
use libc::sockpeercred as ucred;
|
use libc::sockpeercred as ucred;
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "redox", target_os = "android"))]
|
||||||
use libc::ucred;
|
use libc::ucred;
|
||||||
|
|
||||||
pub(crate) fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
|
pub(crate) fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user