socket ancillary data implementation for dragonflybsd.
This commit is contained in:
parent
cafc4582e6
commit
e68887e67c
3 changed files with 92 additions and 8 deletions
|
@ -408,12 +408,12 @@ impl Socket {
|
|||
Ok(raw != 0)
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "linux",))]
|
||||
#[cfg(any(target_os = "android", target_os = "linux", target_os = "dragonfly",))]
|
||||
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 = "linux",))]
|
||||
#[cfg(any(target_os = "android", target_os = "linux", target_os = "dragonfly",))]
|
||||
pub fn passcred(&self) -> io::Result<bool> {
|
||||
let passcred: libc::c_int = getsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED)?;
|
||||
Ok(passcred != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue