diff --git a/tokio/src/net/unix/ucred.rs b/tokio/src/net/unix/ucred.rs index 3390819160a..ce795116ddd 100644 --- a/tokio/src/net/unix/ucred.rs +++ b/tokio/src/net/unix/ucred.rs @@ -60,7 +60,7 @@ pub(crate) use self::impl_solaris::get_peer_cred; #[cfg(target_os = "aix")] pub(crate) use self::impl_aix::get_peer_cred; -#[cfg(any(target_os = "espidf", target_os = "vita"))] +#[cfg(any(target_os = "espidf", target_os = "vita", target_os = "nto"))] pub(crate) use self::impl_noproc::get_peer_cred; #[cfg(any( @@ -307,7 +307,7 @@ pub(crate) mod impl_aix { } } -#[cfg(any(target_os = "espidf", target_os = "vita"))] +#[cfg(any(target_os = "espidf", target_os = "vita", target_os = "nto"))] pub(crate) mod impl_noproc { use crate::net::unix::UnixStream; use std::io; diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index 0fad67cd01a..86266105c71 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -669,7 +669,14 @@ impl Command { /// Sets the child process's user ID. This translates to a /// `setuid` call in the child process. Failure in the `setuid` /// call will cause the spawn to fail. - #[cfg(unix)] + #[cfg(target_os = "nto")] + pub fn uid(&mut self, id: u32) -> &mut Command { + let signed_id = id as i32; + self.std.uid(signed_id); + self + } + + #[cfg(all(unix, not(target_os = "nto")))] #[cfg_attr(docsrs, doc(cfg(unix)))] pub fn uid(&mut self, id: u32) -> &mut Command { self.std.uid(id); @@ -678,10 +685,18 @@ impl Command { /// Similar to `uid` but sets the group ID of the child process. This has /// the same semantics as the `uid` field. - #[cfg(unix)] + #[cfg(target_os = "nto")] + pub fn gid(&mut self, id: u32) -> &mut Command { + let signed_gid = id as i32; + self.std.gid(signed_gid); + self + } + + #[cfg(all(unix, not(target_os = "nto")))] #[cfg_attr(docsrs, doc(cfg(unix)))] pub fn gid(&mut self, id: u32) -> &mut Command { - self.std.gid(id); + let signed_gid = id as i32; + self.std.gid(signed_gid); self }