Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cooperative UCred impl for espidf and other process-less OSes #5868

Merged
merged 1 commit into from Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions tokio/src/net/unix/ucred.rs
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,
})
}
}