From 71982c21245489fd316fc9e82bf7bec4b09d45a6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 17 Mar 2015 10:32:00 -0700 Subject: [PATCH] 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 --- src/liblibc/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 82c54004e9975..1e1b128d71234 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -269,8 +269,8 @@ pub mod types { #[repr(C)] #[derive(Copy)] pub struct sockaddr_storage { pub ss_family: sa_family_t, - pub __ss_align: i64, - pub __ss_pad2: [u8; 112], + pub __ss_align: isize, + pub __ss_pad2: [u8; 128 - 2 * (::core::isize::BYTES as usize)], } #[repr(C)] #[derive(Copy)] pub struct sockaddr_in {