-
Notifications
You must be signed in to change notification settings - Fork 1k
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
msghdr.msg_iovlen is inconsistently declared in gnu and musl #2971
Comments
Hm, glibc seems to declare it as an integer too, see the glibc header source. But changing it would be a breaking change I guess... |
The glibc type should be corrected to match the glibc definition, we can consider this for 0.3 |
The current declaration seems to be correct, the linux-specific socket.h header in glibc declares it as |
My bad, I looked at the generic source 😞 |
So I suppose this issue can be closed then? |
See this musl commit for the background. Essentially, the glibc version matches the one used in the kernel. Musl uses a POSIX-ly correct variant, but then zero-fills the padding in the syscall wrapper before passing it on to the kernel. It is hard to say what the correct approach is here. |
While using socket API in cloud-hypervisor project, I noticed an inconsistency with
msghdr
struct betweengnu
andmusl
targets.In gnu
msghdr.msg_iovlen
is declared assize_t
libc/src/unix/linux_like/linux/gnu/mod.rs
Line 95 in 0488a83
In musl
msghdr.msg_iovlen
is declared asc_int
libc/src/unix/linux_like/linux/musl/b64/mod.rs
Line 98 in 0488a83
cloud-hypervisor/cloud-hypervisor#4642 (comment) describes the error I encountered due to this inconsistency.
Is this expected? If not, could you please fix it?
The text was updated successfully, but these errors were encountered: