-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No longer able to create an unnamed UnixAddr
as of nix 23.0
#1585
Comments
Do you mean an abstract socket? What about https://docs.rs/nix/0.23.0/nix/sys/socket/struct.UnixAddr.html#method.new_abstract ? |
No, an abstract socket implies that it is bound in the abstract namespace, and has a length
|
Ok, I get it. And what do you normally do with unnamed UnixAddrs? |
We have code that intercepts syscalls, so we need to work with Edit: A simpler example, an unnamed socket address can also be passed to For a unix socket:
|
I think maybe this could be implemented with something like: impl UnixAddr {
pub fn new_unnamed() -> Result<UnixAddr> {
unsafe {
let mut ret = libc::sockaddr_un {
sun_family: AddressFamily::Unix as sa_family_t,
.. mem::zeroed()
};
Ok(UnixAddr::from_raw_parts(ret, 2))
}
}
} If you're interested in a PR, let me know. But from #1544 it looks like you might be rewriting the |
It seems that the
UnixAddr
type no longer provides a way to generate an unnamed unix address (a unix address with anaddrlen
of 2, orUnixAddrKind::Unnamed
). This used to be possible in nix 22.0 when the internal struct fields were public.The text was updated successfully, but these errors were encountered: