fix: support musl libc target for linux platform#11
fix: support musl libc target for linux platform#11xiaopengli89 merged 1 commit intobytedance:mainfrom
Conversation
target - Replace manual msghdr struct initialization with mem::zeroed() for safety - Fix type conversion for msg_controllen field from usize to libc type - Fix type conversion for cmsg_len field in control count calculation - Apply consistent unsafe zeroed initialization for both send and receive paths
|
cargo build --target=x86_64-unknown-linux-musl -p ipmb error[E0308]: mismatched types error[E0308]: mismatched types error[E0277]: cannot subtract error[E0308]: mismatched types error[E0277]: cannot divide error: cannot construct error[E0308]: mismatched types Some errors have detailed explanations: E0277, E0308. error[E0308]: mismatched types error[E0308]: mismatched types error[E0277]: cannot subtract error[E0308]: mismatched types error[E0277]: cannot divide error: cannot construct error[E0308]: mismatched types Some errors have detailed explanations: E0277, E0308. error[E0308]: mismatched types error[E0308]: mismatched types error[E0277]: cannot subtract error[E0308]: mismatched types error[E0277]: cannot divide error: cannot construct error[E0308]: mismatched types Some errors have detailed explanations: E0277, E0308. |
|
Thanks. |
|
Hi @xiaopengli89, Would you please update this to crates.io as soon as possible? We have a project that's actively using this library and would really appreciate having this fix available. Thank you! |
|
|
tks |
Use mem::zeroed() to initialize msghdr struct instead of struct literal
syntax, as musl libc has private padding fields (__pad1, __pad2) that
prevent direct construction. Also add type casts for msg_controllen and
cmsg_len to handle the type difference between musl (u32) and glibc
(usize).