Skip to content

Commit b4ae660

Browse files
he32tgross35
authored andcommitted
src/new/netbsd/net/if_.rs: make if_msghdr self-tests succeed on ilp32 hosts:
This fixes the following errors from `cd libc-test; cargo test`: bad `if_msghdr` size: rust: 148 != c 152 bad `if_msghdr` align: rust: 4 != c 8 and size of `struct if_msghdr` is 152 in C and 148 in Rust as verified natively on NetBSD/i386 10.0 with rust 1.92.0. Ref. https://nxr.netbsd.org/xref/src/sys/net/if.h#790 for the original C definition of `struct if_msghdr`. (backport <rust-lang#4902>) (cherry picked from commit 86dbfd4)
1 parent 287e383 commit b4ae660

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/new/netbsd/net/if_.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub const IFF_LINK2: c_int = 0x4000; // per link layer defined bit
5050
pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast
5151

5252
s! {
53+
#[repr(C, align(8))]
5354
pub struct if_msghdr {
5455
pub ifm_msglen: c_ushort,
5556
pub ifm_version: c_uchar,

0 commit comments

Comments
 (0)