]> git.lizzy.rs Git - rust.git/commitdiff
libc: Fix definition of sockaddr_storage on 32-bit linux
authorAlex Crichton <alex@alexcrichton.com>
Tue, 17 Mar 2015 17:32:00 +0000 (10:32 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 17 Mar 2015 17:33:13 +0000 (10:33 -0700)
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

index 82c54004e99752a25fce167bac6a9fd930104d11..1e1b128d71234abc3da8c11b453d2c3c1cb99602 100644 (file)
@@ -269,8 +269,8 @@ pub mod bsd44 {
                 #[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 {