Various unix socket fixes (+socketpair!)

This commit is contained in:
jD91mZM2
2020-06-27 16:15:27 +02:00
parent b7053b673d
commit f8b49936bc
3 changed files with 80 additions and 28 deletions
+9
View File
@@ -5,3 +5,12 @@ pub struct sockaddr_un {
pub sun_family: sa_family_t,
pub sun_path: [c_char; 108],
}
impl sockaddr_un {
pub fn path_len(&self) -> usize {
let base = self as *const _ as usize;
let path = &self.sun_path as *const _ as usize;
trace!("base: {:#X}, path: {:#X}", base, path);
path - base
}
}