Skip to content

some libc solaris definitions are not correct #515

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

Closed
binarycrusader opened this issue Feb 8, 2017 · 0 comments · Fixed by #516 or binarycrusader/libc#1
Closed

some libc solaris definitions are not correct #515

binarycrusader opened this issue Feb 8, 2017 · 0 comments · Fixed by #516 or binarycrusader/libc#1

Comments

@binarycrusader
Copy link
Contributor

There are a few somewhat subtle errors in the definitions found in src/unix/solaris/mod.rs.

  1. pthread_t should be a c_uint, not a uintptr_t just as pthread_key_t is defined
  2. fd_set is actually a long on Solaris, so needs to change definition based on target_pointer_width; not only is this only working by chance right now, it prevents process spawning from working correctly on sparc since the 32-bit value is placed in the lower half of the 64-bit value passed to select/pselect
  3. for lp64, FD_SETSIZE should actually be 65536 as has been true since 1997

I will send a pull request shortly with proposed fixes. This is the first time I've sent a pull request, so please let me know if I've missed any steps (I've tried to follow the instructions at https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#pull-requests).

/cc @dhduvall

binarycrusader added a commit to binarycrusader/libc that referenced this issue Feb 8, 2017
* pthread_t is defined as uint_t, so must be c_uint, not uintptr_t, just
  as pthread_key_t is already defined
* fd_set is defined as long, so must be i32/i64 based on
  target_pointer_width; this also fixes an indirect endianness issue
  encountered on sparc
* FD_SETSIZE should be defined as 65536 when target_pointer_width = 64

Fixes rust-lang#515
bors added a commit that referenced this issue Feb 8, 2017
Correct solaris libc definitions:

* pthread_t is defined as uint_t, so must be c_uint, not uintptr_t, just
  as pthread_key_t is already defined
* fd_set is defined as long, so must be i32/i64 based on
  target_pointer_width; this also fixes an indirect endianness issue
  encountered on sparc
* FD_SETSIZE should be defined as 65536 when target_pointer_width = 64

Fixes #515
bors added a commit that referenced this issue Feb 10, 2017
Correct solaris libc definitions:

* pthread_t is defined as uint_t, so must be c_uint, not uintptr_t, just
  as pthread_key_t is already defined
* fd_set is defined as long, so must be i32/i64 based on
  target_pointer_width; this also fixes an indirect endianness issue
  encountered on sparc
* FD_SETSIZE should be defined as 65536 when target_pointer_width = 64

Fixes #515
@bors bors closed this as completed in #516 Feb 10, 2017
Susurrus pushed a commit to Susurrus/libc that referenced this issue Mar 26, 2017
Update bitflags to 0.7

Brought to you by GNU sed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant