From 227979f0918b2fa8f70ac6040d6281a9e1365641 Mon Sep 17 00:00:00 2001 From: Sebastian Schildt Date: Tue, 14 May 2024 20:11:37 +0900 Subject: [PATCH] net: support QNX OS (#6421) Co-authored-by: Akhil Thankachan Thomas --- tokio/src/net/unix/ucred.rs | 4 ++-- tokio/src/process/mod.rs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tokio/src/net/unix/ucred.rs b/tokio/src/net/unix/ucred.rs index 339081916..bcd1c755f 100644 --- a/tokio/src/net/unix/ucred.rs +++ b/tokio/src/net/unix/ucred.rs @@ -39,7 +39,7 @@ impl UCred { ))] pub(crate) use self::impl_linux::get_peer_cred; -#[cfg(target_os = "netbsd")] +#[cfg(any(target_os = "netbsd", target_os = "nto"))] pub(crate) use self::impl_netbsd::get_peer_cred; #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] @@ -120,7 +120,7 @@ pub(crate) mod impl_linux { } } -#[cfg(target_os = "netbsd")] +#[cfg(any(target_os = "netbsd", target_os = "nto"))] pub(crate) mod impl_netbsd { use crate::net::unix::{self, UnixStream}; diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index 0fad67cd0..fc661d89c 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -672,6 +672,8 @@ impl Command { #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] pub fn uid(&mut self, id: u32) -> &mut Command { + #[cfg(target_os = "nto")] + let id = id as i32; self.std.uid(id); self } @@ -681,6 +683,8 @@ impl Command { #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] pub fn gid(&mut self, id: u32) -> &mut Command { + #[cfg(target_os = "nto")] + let id = id as i32; self.std.gid(id); self }