Description
I was trying to use nix to go from a libc::sockaddr
to a std::net::SockAddr
. This is useful when using recvmsg
to receive data off a UDP socket or when using the equivalent io_uring operations. I notice that from_libc_sockaddr
(
Line 959 in 5cd01a1
The change is of course trivial to make, I wanted to create an issue just to understand if there were concerns around marking it pub
. One possible concern I can imagine is that it is marked unsafe at the moment, I imagine this is because of the pointer cast but I have to admit I am not sure how to make it safer because the code already ensures that the passed pointer is not null, so the checks required would need to ensure that the pointer is to a 4-byte allocation, which is non-trivial. On the other hand, maybe unsafe exports are unavoidable from nix and there are already cases, e.g., ptsname
(
Line 175 in 83cd1da
The current situation requires that I copy the code into my project (or rewrite a more restricted version), and I want to avoid that if possible. Let me know if this is acceptable and I am happy to submit a PR.