-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sockaddr_storage in libc is incorrectly defined (on 32 bit systems at least) #23425
Comments
Ok, I believe that the definition should be: pub struct sockaddr_storage {
pub ss_family: sa_family_t,
pub __ss_align: u32,
pub __ss_pad2: [u8; 120],
} |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Mar 17, 2015
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 rust-lang#23425
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Mar 18, 2015
…r=brson 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 rust-lang#23425
homu
added a commit
to nix-rust/nix
that referenced
this issue
Jan 11, 2017
Always use libc's socketaddr_storage Since rust-lang/rust#23425 is closed, we no longer need the special case.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe that on 32 bit linux,
sizeof(struct sockaddr_storage)
=> 128, in rust => 124. I glanced at the definition in rust and it does look suspect with respect to portability.The text was updated successfully, but these errors were encountered: