Actually, I should fix that function, since the structure size is false (some version of sockaddr_un have a sun_len field). Returning mem::size_of::<libc::sockaddr_un>() for the len will be better.