From 02544540f198e07a6db5a8679c60b753fd1e0d4c Mon Sep 17 00:00:00 2001 From: Josh Guilfoyle Date: Wed, 19 Jul 2023 02:24:13 -0700 Subject: [PATCH] net: implement `UCred` for espidf (#5868) --- tokio/src/net/unix/ucred.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tokio/src/net/unix/ucred.rs b/tokio/src/net/unix/ucred.rs index edfab08ab08..556c8fecb29 100644 --- a/tokio/src/net/unix/ucred.rs +++ b/tokio/src/net/unix/ucred.rs @@ -54,6 +54,9 @@ pub(crate) use self::impl_solaris::get_peer_cred; #[cfg(target_os = "aix")] pub(crate) use self::impl_aix::get_peer_cred; +#[cfg(target_os = "espidf")] +pub(crate) use self::impl_noproc::get_peer_cred; + #[cfg(any( target_os = "linux", target_os = "redox", @@ -291,3 +294,17 @@ pub(crate) mod impl_aix { } } } + +#[cfg(target_os = "espidf")] +pub(crate) mod impl_noproc { + use crate::net::unix::UnixStream; + use std::io; + + pub(crate) fn get_peer_cred(_sock: &UnixStream) -> io::Result { + Ok(super::UCred { + uid: 0, + gid: 0, + pid: None, + }) + } +}