mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 14:13:38 +00:00
Remove passcred
for emscripten
This commit is contained in:
parent
6b0c3dfe00
commit
e9bf69954c
@ -757,7 +757,7 @@ impl UnixDatagram {
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
#[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 set_passcred(&self, passcred: bool) -> io::Result<()> {
|
||||
self.0.set_passcred(passcred)
|
||||
@ -769,7 +769,7 @@ impl UnixDatagram {
|
||||
/// Get the socket option `SO_PASSCRED`.
|
||||
///
|
||||
/// [`set_passcred`]: UnixDatagram::set_passcred
|
||||
#[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 passcred(&self) -> io::Result<bool> {
|
||||
self.0.passcred()
|
||||
|
@ -375,7 +375,7 @@ impl UnixStream {
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
#[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 set_passcred(&self, passcred: bool) -> io::Result<()> {
|
||||
self.0.set_passcred(passcred)
|
||||
@ -387,7 +387,7 @@ impl UnixStream {
|
||||
/// Get the socket option `SO_PASSCRED`.
|
||||
///
|
||||
/// [`set_passcred`]: UnixStream::set_passcred
|
||||
#[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 passcred(&self) -> io::Result<bool> {
|
||||
self.0.passcred()
|
||||
|
@ -341,12 +341,12 @@ impl Socket {
|
||||
Ok(raw != 0)
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux",))]
|
||||
#[cfg(any(target_os = "android", target_os = "linux",))]
|
||||
pub fn set_passcred(&self, passcred: bool) -> io::Result<()> {
|
||||
setsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED, passcred as libc::c_int)
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux",))]
|
||||
#[cfg(any(target_os = "android", target_os = "linux",))]
|
||||
pub fn passcred(&self) -> io::Result<bool> {
|
||||
let passcred: libc::c_int = getsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED)?;
|
||||
Ok(passcred != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user