in src/bsd.rs [87:95]
fn new() -> Result<Self> {
let mut ifap = Self::default();
// getifaddrs allocates memory for the linked list of interfaces that is freed by
// `IfAddrs::drop`.
if unsafe { getifaddrs(ptr::from_mut(&mut ifap.0)) } != 0 {
return Err(Error::last_os_error());
}
Ok(ifap)
}