Files
RedBear-OS/src/header/sys_un/mod.rs
T
jD91mZM2 39ce623d2d Fix bind/connect's AF_UNIX socket path... again
I don't really know for sure what all these silly rules are, but I think
I got it now...
2020-06-29 11:36:07 +02:00

17 lines
418 B
Rust

use crate::{header::sys_socket::sa_family_t, platform::types::*};
#[repr(C)]
pub struct sockaddr_un {
pub sun_family: sa_family_t,
pub sun_path: [c_char; 108],
}
impl sockaddr_un {
pub fn path_offset(&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
}
}