diff options
| author | LinkTed <LinkTed@users.noreply.github.com> | 2020-09-22 22:21:27 +0200 |
|---|---|---|
| committer | LinkTed <LinkTed@users.noreply.github.com> | 2020-10-10 15:19:13 +0200 |
| commit | 889c9272cb670891ed3b2dca4aef4f333110fee7 (patch) | |
| tree | 022111d675bfcb904bd4abc96cbcf7c0c6289105 /library/std/src | |
| parent | 0fcb83483240a274016aa2552952a42a97168c31 (diff) | |
| download | rust-889c9272cb670891ed3b2dca4aef4f333110fee7.tar.gz rust-889c9272cb670891ed3b2dca4aef4f333110fee7.zip | |
Remove `SocketCred` for `emscripten`
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sys/unix/ext/net/ancillary.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/sys/unix/ext/net/ancillary.rs index 0266df46098..112d72dc29b 100644 --- a/library/std/src/sys/unix/ext/net/ancillary.rs +++ b/library/std/src/sys/unix/ext/net/ancillary.rs @@ -9,7 +9,7 @@ use crate::slice::from_raw_parts; use crate::sys::unix::ext::net::addr::{sockaddr_un, SocketAddr}; use crate::sys::unix::net::Socket; -#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux",))] +#[cfg(any(target_os = "android", target_os = "linux",))] use libc::{gid_t, pid_t, uid_t}; pub(super) fn recv_vectored_with_ancillary_from( @@ -167,12 +167,12 @@ impl<'a, T> Iterator for AncillaryDataIter<'a, T> { } /// Unix credential. -#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))] +#[cfg(any(doc, target_os = "android", target_os = "linux",))] #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")] #[derive(Clone)] pub struct SocketCred(libc::ucred); -#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))] +#[cfg(any(doc, target_os = "android", target_os = "linux",))] impl SocketCred { /// Create a Unix credential struct. /// @@ -237,11 +237,11 @@ impl<'a> Iterator for ScmRights<'a> { /// This control message contains unix credentials. /// /// The level is equal to `SOL_SOCKET` and the type is equal to `SCM_CREDENTIALS` or `SCM_CREDS`. -#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))] +#[cfg(any(doc, target_os = "android", target_os = "linux",))] #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")] pub struct ScmCredentials<'a>(AncillaryDataIter<'a, libc::ucred>); -#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))] +#[cfg(any(doc, target_os = "android", target_os = "linux",))] #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")] impl<'a> Iterator for ScmCredentials<'a> { type Item = SocketCred; @@ -263,7 +263,7 @@ pub enum AncillaryError { #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")] pub enum AncillaryData<'a> { ScmRights(ScmRights<'a>), - #[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))] + #[cfg(any(doc, target_os = "android", target_os = "linux",))] ScmCredentials(ScmCredentials<'a>), } @@ -286,7 +286,7 @@ impl<'a> AncillaryData<'a> { /// /// `data` must contain a valid control message and the control message must be type of /// `SOL_SOCKET` and level of `SCM_CREDENTIALS` or `SCM_CREDENTIALS`. - #[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))] + #[cfg(any(doc, target_os = "android", target_os = "linux",))] unsafe fn as_credentials(data: &'a [u8]) -> Self { let ancillary_data_iter = AncillaryDataIter::new(data); let scm_credentials = ScmCredentials(ancillary_data_iter); @@ -303,11 +303,7 @@ impl<'a> AncillaryData<'a> { match (*cmsg).cmsg_level { libc::SOL_SOCKET => match (*cmsg).cmsg_type { libc::SCM_RIGHTS => Ok(AncillaryData::as_rights(data)), - #[cfg(any( - target_os = "android", - target_os = "emscripten", - target_os = "linux", - ))] + #[cfg(any(target_os = "android", target_os = "linux",))] libc::SCM_CREDENTIALS => Ok(AncillaryData::as_credentials(data)), cmsg_type => { Err(AncillaryError::Unknown { cmsg_level: libc::SOL_SOCKET, cmsg_type }) @@ -505,7 +501,7 @@ impl<'a> SocketAncillary<'a> { /// Technically, that means this operation adds a control message with the level `SOL_SOCKET` /// and type `SCM_CREDENTIALS` or `SCM_CREDS`. /// - #[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))] + #[cfg(any(doc, target_os = "android", target_os = "linux",))] #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")] pub fn add_creds(&mut self, creds: &[SocketCred]) -> bool { self.truncated = false; |
