Skip to content

Commit 1375070

Browse files
author
Danek Duvall
committed
struct addrinfo needs padding on Solaris/SPARC
64-bit Solaris/SPARC has a 4-byte pad before ai_addrlen for historical reasons (ai_addrlen used to be defined as a size_t, which is 4 bytes in ILP32 and 8 in LP64, but was converted to a 4-byte socklen_t in Solaris 10, which necessitated padding for (more or less) binary compatibility).
1 parent 6c0ff9e commit 1375070

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/unix/solaris/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ s! {
208208
pub ai_family: ::c_int,
209209
pub ai_socktype: ::c_int,
210210
pub ai_protocol: ::c_int,
211+
#[cfg(target_arch = "sparc64")]
212+
__sparcv9_pad: ::c_int,
211213
pub ai_addrlen: ::socklen_t,
212214
pub ai_canonname: *mut ::c_char,
213215
pub ai_addr: *mut ::sockaddr,

0 commit comments

Comments
 (0)