Skip to content

Commit 71982c2

Browse files
committed
libc: Fix definition of sockaddr_storage on 32-bit linux
The alignment field is actually a "pointer sized" type instead of always i64, requiring that the size of the padding field is also calculated slightly differently. Closes #23425
1 parent c64d671 commit 71982c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/liblibc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ pub mod types {
269269
#[repr(C)]
270270
#[derive(Copy)] pub struct sockaddr_storage {
271271
pub ss_family: sa_family_t,
272-
pub __ss_align: i64,
273-
pub __ss_pad2: [u8; 112],
272+
pub __ss_align: isize,
273+
pub __ss_pad2: [u8; 128 - 2 * (::core::isize::BYTES as usize)],
274274
}
275275
#[repr(C)]
276276
#[derive(Copy)] pub struct sockaddr_in {

0 commit comments

Comments
 (0)