Skip to content
Snippets Groups Projects
  1. Feb 07, 2019
  2. Feb 05, 2019
    • bors's avatar
      Auto merge of #1235 - asomers:cmsg_osx, r=gnzlbg · f9b96ee6
      bors authored
      Fix cmsg(3) bugs for musl and OSX
      
      This PR fixes bugs in the cmsg(3) family of functions for Linux/musl and OSX, introduced by PR #1098 and PR #1212 .  It also adds an integration test which hopefully will validate these functions on every platform.
      f9b96ee6
    • Alan Somers's avatar
      Add an integration test for the cmsg(3) functions. · 38cf5b15
      Alan Somers authored
      Since these are defined in C as macros, they must be reimplemented in
      libc as Rust functions.  They're hard to get exactly right, and they
      vary from platform to platform.  The test builds custom C code that uses
      the real macros, and compares its output to the Rust versions' output
      for various inputs.
      
      Skip the CMSG_NXTHDR test on sparc64 linux because it hits a Bus Error.
      
      Issue #1239
      
      Skip the entire cmsg test program on s390x because it dumps core
      seemingly before the kernel finishes booting.
      
      Issue #1240
      38cf5b15
    • Alan Somers's avatar
      eddc8d34
    • Alan Somers's avatar
      Fix Linux's CMSG_NXTHDR and CMSG_SPACE definitions. · 4300666b
      Alan Somers authored
      This is an error from PR #1098.  The wrong definitions coincidentally
      work on Linux/glibc, but fail on Linux/musl.
      4300666b
    • Alan Somers's avatar
      Fix CMSG_NXTHDR for OSX. · 73df81fc
      Alan Somers authored
      This was an oversight from PR #1212.  It's been revealed by the new cmsg
      test.
      73df81fc
    • bors's avatar
      Auto merge of #1234 - gnzlbg:android_runtest, r=gnzlbg · be1a8ded
      bors authored
      Update runtest-android
      
      Keep the implementation in sync with packed_simd and stdsimd.
      be1a8ded
    • bors's avatar
      Auto merge of #1217 - Susurrus:rfc_2235, r=gnzlbg · 942f6ae7
      bors authored
      RFC 2235 - Implement PartialEq,Eq,Hash,Debug for all types
      
      First pass at implementing [RFC2235](https://github.com/rust-lang/rfcs/blob/master/text/2235-libc-struct-traits.md). I just started with `PartialEq`/`Eq` and tested locally on my x64 Linux system. Definitely going to run into other types for other platforms that need this treatment, but thought I'd start small.
      
      Open question is whether this should also rely on the `align` feature, which should improve which types can be auto-derived versus manually implemented (as it removed a lot of odd-sized padding arrays). My first pass here doesn't do that, but I might test it out to see if it does simplify quite a few structs. I think it might also be nice to have as it makes it easier for contributors to add new structs.
      
      Part of rust-lang/rust#57715
      942f6ae7
  3. Feb 04, 2019
  4. Feb 03, 2019
  5. Feb 02, 2019
  6. Jan 30, 2019
  7. Jan 28, 2019
  8. Jan 26, 2019
  9. Jan 23, 2019
  10. Jan 22, 2019
  11. Jan 21, 2019
  12. Jan 17, 2019
    • bors's avatar
      Auto merge of #1212 - asomers:cmsg, r=alexcrichton · 70284d78
      bors authored
      Fix CMSG_DATA(3) and friends on BSD
      
      PR #1098 added the CMSG_DATA(3) family of functions into libc.  Because
      they're defined as macros in C, they had to be rewritten as Rust
      functions for libc.  Also, they can't be tested in CI for the same
      reason.  But that PR erroneously used the same definitions in BSD as in
      Linux.
      
      This commit corrects the definitions for OSX, FreeBSD, DragonflyBSD,
      OpenBSD, and NetBSD.  I renamed a few variables and collapsed a few
      macros in order to combine the definitions where possible.
      
      Fixes #1210
      70284d78
  13. Jan 16, 2019
    • Alan Somers's avatar
      Fix CMSG_DATA(3) and friends on BSD · 8067378d
      Alan Somers authored
      PR #1098 added the CMSG_DATA(3) family of functions into libc.  Because
      they're defined as macros in C, they had to be rewritten as Rust
      functions for libc.  Also, they can't be tested in CI for the same
      reason.  But that PR erroneously used the same definitions in BSD as in
      Linux.
      
      This commit corrects the definitions for OSX, FreeBSD, DragonflyBSD,
      OpenBSD, and NetBSD.  I renamed a few variables and collapsed a few
      macros in order to combine the definitions where possible.
      
      Fixes #1210
      8067378d
  14. Jan 15, 2019
    • bors's avatar
      Auto merge of #1211 - asomers:netbsd_aio, r=gnzlbg · 6b8ef413
      bors authored
      Fix linking aio_read(3) and friends on NetBSD
      
      The aio functions require librt on NetBSD.
      6b8ef413
    • bors's avatar
      Auto merge of #1201 - thendiscard:master, r=gnzlbg · ac6e2a79
      bors authored
      Remove fexecve from netbsdlike as it's not implemented
      
      Sometimes it causes confusion in downstream users of libc, for example it caused nix-rust/nix to fail to compile on OpenBSD 6.4 (see https://github.com/nix-rust/nix/pull/1000).
      
      OpenBSD doesn't implement fexecve. The only reference of it that I can
      find in the OpenBSD source is in the man pages of signal(3) and
      sigaction(2) (where it's mentioned that it is not implemented).
      
      OpenBSD official source code link:
      https://cvsweb.openbsd.org/src/lib/libc/sys/sigaction.2?rev=1.75&content-type=text/x-cvsweb-markup
      
      OpenBSD Github mirror:
      https://github.com/openbsd/src/blob/master/lib/libc/sys/sigaction.2#L619
      
      On NetBSD's unistd.h I see that it is under an ifdef. Calling it returns
      78 / ENOSYS / Function not implemented.
      
      NetBSD office source code link:
      http://cvsweb.netbsd.org/bsdweb.cgi/src/include/unistd.h?rev=1.151&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
      
      NetBSD Github mirror:
      https://github.com/NetBSD/src/blob/trunk/include/unistd.h#L319
      
      Tests on OpenBSD 6.4 after the change:
      ```bash
      user@openbsd64 ~/RUST/libc $ cargo build
         Compiling libc v0.2.46 (/home/user/RUST/libc)
          Finished dev [unoptimized + debuginfo] target(s) in 3.88s
      
      user@openbsd64 ~/RUST/libc $ cargo build --release
         Compiling libc v0.2.46 (/home/user/RUST/libc)
          Finished release [optimized] target(s) in 2.21s
      
      user@openbsd64 ~/RUST/libc/libc-test $ cargo test
         Compiling proc-macro2 v0.4.24
         Compiling unicode-xid v0.1.0
         Compiling semver-parser v0.7.0
         Compiling serde v1.0.84
         Compiling libc v0.2.45
         Compiling num-traits v0.2.6
         Compiling ryu v0.2.7
         Compiling cfg-if v0.1.6
         Compiling itoa v0.4.3
         Compiling term v0.4.6
         Compiling bitflags v0.9.1
         Compiling cc v1.0.28
         Compiling libc v0.2.46 (/home/user/RUST/libc)
         Compiling log v0.4.6
         Compiling semver v0.9.0
         Compiling log v0.3.9
         Compiling rustc_version v0.2.3
         Compiling rand v0.4.3
         Compiling extprim v1.6.0
         Compiling quote v0.6.10
         Compiling syn v0.15.23
         Compiling serde_derive v1.0.84
         Compiling syntex_pos v0.59.1
         Compiling serde_json v1.0.34
         Compiling syntex_errors v0.59.1
         Compiling syntex_syntax v0.59.1
         Compiling ctest v0.2.8
         Compiling libc-test v0.1.0 (/home/user/RUST/libc/libc-test)
          Finished dev [unoptimized + debuginfo] target(s) in 2m 16s
           Running /home/user/RUST/libc/target/debug/deps/linux_fcntl-08861a7cd96d1b94
      RUNNING ALL TESTS
      PASSED 0 tests
           Running /home/user/RUST/libc/target/debug/deps/main-57e266d38aa58cce
      RUNNING ALL TESTS
      PASSED 7187 tests
      ```
      I've tried running the tests on a NetBSD 8.0 box unfortunately there `libc-test` fails to compile even before this change.
      ac6e2a79
    • bors's avatar
      Auto merge of #1188 - pusateri:netbsd8, r=gnzlbg · 18b0102b
      bors authored
      NetBSD 8 adds new address family changing AF_MAX and new ifaddrs flags.
      
      libc-test on NetBSD 8.0  fails without these changes.
      ifa_addrflags was added to struct ifaddrs to support AF_CAN.
      AF_MAX got bumped up one by AF_CAN.
      RT_IFLIST format changed to support ifa_addrflags.
      18b0102b
Loading