Skip to content

Commit

Permalink
net: implement UCred for espidf (#5868)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasta authored Jul 19, 2023
1 parent d64c8e3 commit 0254454
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tokio/src/net/unix/ucred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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<super::UCred> {
Ok(super::UCred {
uid: 0,
gid: 0,
pid: None,
})
}
}

0 comments on commit 0254454

Please sign in to comment.