Skip to content

Commit 00af6ef

Browse files
net: add support for Redox OS (#5790)
1 parent b729091 commit 00af6ef

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

tokio/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ tracing = { version = "0.1.25", default-features = false, features = ["std"], op
121121
backtrace = { version = "0.3.58" }
122122

123123
[target.'cfg(unix)'.dependencies]
124-
libc = { version = "0.2.42", optional = true }
124+
libc = { version = "0.2.145", optional = true }
125125
signal-hook-registry = { version = "1.1.1", optional = true }
126126

127127
[target.'cfg(unix)'.dev-dependencies]
128-
libc = { version = "0.2.42" }
128+
libc = { version = "0.2.145" }
129129
nix = { version = "0.26", default-features = false, features = ["fs", "socket"] }
130130

131131
[target.'cfg(windows)'.dependencies.windows-sys]

tokio/src/net/unix/ucred.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ impl UCred {
3131
}
3232
}
3333

34-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "openbsd"))]
34+
#[cfg(any(
35+
target_os = "linux",
36+
target_os = "redox",
37+
target_os = "android",
38+
target_os = "openbsd"
39+
))]
3540
pub(crate) use self::impl_linux::get_peer_cred;
3641

3742
#[cfg(any(target_os = "netbsd"))]
@@ -49,7 +54,12 @@ pub(crate) use self::impl_solaris::get_peer_cred;
4954
#[cfg(target_os = "aix")]
5055
pub(crate) use self::impl_aix::get_peer_cred;
5156

52-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "openbsd"))]
57+
#[cfg(any(
58+
target_os = "linux",
59+
target_os = "redox",
60+
target_os = "android",
61+
target_os = "openbsd"
62+
))]
5363
pub(crate) mod impl_linux {
5464
use crate::net::unix::{self, UnixStream};
5565

@@ -58,7 +68,7 @@ pub(crate) mod impl_linux {
5868

5969
#[cfg(target_os = "openbsd")]
6070
use libc::sockpeercred as ucred;
61-
#[cfg(any(target_os = "linux", target_os = "android"))]
71+
#[cfg(any(target_os = "linux", target_os = "redox", target_os = "android"))]
6272
use libc::ucred;
6373

6474
pub(crate) fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {

0 commit comments

Comments
 (0)