- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
Openbsd cleanup #110
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
Openbsd cleanup #110
Conversation
- under openbsd and bitrig: dli_saddr member is *mut ::c_void - under netbsd: it is *const ::c_void
- IPV6_{ADD,DROP}_MEMBERSHIP
- HW_AVAILCPU
    - same prototype on bitrig and openbsd - for netbsd, I did found it at all (?)
- sysctl: *mut -> *const - mprotect: *const -> *mut - remove sysctlbyname() that don't exists under openbsd
arguments `hostlen' and `servlen' are `socklen_t' or `size_t' depending the platform - apple: I don't known, so I don't change the original definition (socklen_t) - netbsd: socklen_t - freebsd: size_t - dragonfly: size_t - openbsd: size_t - bitrig: size_t
- openbsd - bitrig - netbsd
under openbsd it is a `caddr_t` which expand to `char *`. as the size of the type change, adjust the padding too.
- under openbsd/bitrig it is 256 - change type to `size_t` where system have `getnameinfo()` with `hostlen` as `size_t`
SYS_entropy is internal and may more easily change than getentropy(2).
b456542    to
    6b84742      
    Compare
  
            
          
                libc-test/build.rs
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this struct field be updated on openbsd to match the name in C? For renamings like this Rust shouldn't differ much
| Thanks! I think it's fine to have some breakage here because this isn't a "tier 1 platform" of this library currently (e.g. there's no CI set up for it), but this is a great foundation to start from now! | 
b16d4c7    to
    f441948      
    Compare
  
    f441948    to
    6c8a63a      
    Compare
  
    | @alexcrichton I don't understand the failure for  the previous one (6b84742) was ok, and adding 6c8a63a would make a linkage problem with  | 
| Thanks @semarie! I'll work on getting this merged (mips failures are likely unrelated) | 
The following PR is the result of running
libc-testunder OpenBSD, and corrects all problems.I have keeped separated commits for reviewing.
Some commits touch BSD globally (
getnameinfofor example). In these cases, I have tried to review definitions in system code source.Please note that this version of libc will break openbsd target for rustc. There are three breaking change:
HW_AVAILCPU: it will breaknum_cpus()insidesrc/libtest/lib.rsNR_GETENTROPYconstant don't exist under this name (it isSYS_getentropy). But I also remove it and declare the functiongetentropy()which should be a more stable API. The current use is insidesrc/libstd/rand/os.rssiginfo_t.si_addrisn't compatible with the current definition ofsiginfo_si_addr()insrc/libstd/sys/unix/stack_overflow.rsFor all these problems, I have pending patches.