Commit graph

2569 commits

Author SHA1 Message Date
Bryant Mairs e33f7609bd Ignore the style executable used for testing
This is used for running style checks on the libc codebase but shouldn't
be committed, so adding it to the .gitignore file.
2019-02-02 16:32:00 -08:00
Bryant Mairs f3684584c9 Check for Copy impls for all types 2019-02-02 16:32:00 -08:00
Bryant Mairs fa9cb78b4a Check for Debug impls for all types
This was not compile-tested on all platforms, but instead all `pub enum`
types had a `Debug` impl derived for them.
2019-02-02 16:32:00 -08:00
Bryant Mairs cd1e16d1af Implement Hash for all types 2019-02-02 16:32:00 -08:00
Bryant Mairs 79ae1217c2 Implement Debug for all types 2019-02-02 13:06:58 -08:00
Bryant Mairs 868a85d05d Implement PartialEq,Eq for all types 2019-02-02 13:06:58 -08:00
Bryant Mairs 51a0587b53 Remove Cargo.lock
This was an artifact from when a git dependency on ctest was used. This
is no longer the case, so removing it to simplify future PRs.
2019-01-23 08:42:58 -08:00
bors 42cd3ba272 Auto merge of #1228 - gnzlbg:release, r=gnzlbg
Bump to 0.2.48

Bumps libc version to 0.2.48. This release contains the breaking changes performed in #1222 .
2019-01-23 13:32:05 +00:00
gnzlbg 9148ae9023 Bump to 0.2.48 2019-01-23 14:14:01 +01:00
bors e979ffff51 Auto merge of #1222 - MikaelUrankar:stack_t_bsd, r=gnzlbg
fix stack_t on FreeBSD

FreeBSD 10.x is EOL, in FreeBSD 11 and later, ss_sp is actually a void* [1]
dragonflybsd still uses c_char [2]

[1] https://svnweb.freebsd.org/base/releng/11.2/sys/sys/signal.h?revision=334459&view=markup#l438
[2] https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/signal.h#L339

should be committed with https://github.com/rust-lang/rust/pull/57810
2019-01-23 11:08:59 +00:00
Your Name 5e187562ee FreeBSD 10.x is EOL, in FreeBSD 11 and later, ss_sp is actually a void* [1]
dragonflybsd still uses c_char [2]

[1] https://svnweb.freebsd.org/base/releng/11.2/sys/sys/signal.h?revision=334459&view=markup#l438
[2] https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/signal.h#L339
2019-01-22 17:16:26 +01:00
bors fb2b3dac03 Auto merge of #1224 - gnzlbg:fix_android, r=gnzlbg
Re-enable android build jobs

This performs a `yes | ./sdk/tools/bin/sdkmanager --licenses` - the sole purpose of the `--licenses` flag is to allow the user to accept all licenses a priori, so that all other commands don't show any licenses.

For some reason, after all licenses have been accepted, the install step says that some licenses are still not accepted... so we need to accept those too... Why? I have no idea, and accepting licenses while installing still appears to make things hang a little, but it only does so for one non-accepted license, instead of for 5-6 like before, so now things do work.
2019-01-21 21:05:07 +00:00
gnzlbg 4f9cc1a208 Fix indentation of allow_failures 2019-01-21 22:04:14 +01:00
gnzlbg b71ea8ba24 Allow emscripten asmjs and wasm32 targets to fail 2019-01-21 21:23:44 +01:00
gnzlbg 5a7b4e7796 MFD_HUGETLB does not appear to be available on x86_64-android 2019-01-21 20:34:43 +01:00
gnzlbg 45adbf88dd Re-enables android build jobs
Closes #1170 .
2019-01-21 20:34:43 +01:00
bors 70284d78ee Auto merge of #1212 - asomers:cmsg, r=alexcrichton
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
2019-01-17 16:45:13 +00:00
Alan Somers 8067378d21 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
2019-01-16 08:32:20 -07:00
bors 6b8ef413a3 Auto merge of #1211 - asomers:netbsd_aio, r=gnzlbg
Fix linking aio_read(3) and friends on NetBSD

The aio functions require librt on NetBSD.
2019-01-15 17:44:10 +00:00
bors ac6e2a79b5 Auto merge of #1201 - thendiscard:master, r=gnzlbg
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.
2019-01-15 11:04:59 +00:00
bors 18b0102b98 Auto merge of #1188 - pusateri:netbsd8, r=gnzlbg
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.
2019-01-15 10:25:04 +00:00
Alan Somers e2d584d7bb Fix linking aio_read(3) and friends on NetBSD
The aio functions require librt on NetBSD.
2019-01-14 23:22:00 -07:00
bors ce1dfcbf81 Auto merge of #1209 - jackpot51:master, r=alexcrichton
Bump version to 0.2.47

This will release changes to the Redox module
2019-01-14 18:18:14 +00:00
bors 6bf778ada2 Auto merge of #1206 - semarie:mincore, r=gnzlbg
mincore has been removed from upcoming OpenBSD 6.5

remove test from CI on OpenBSD for "mincore" function.

it has been removed from upcoming 6.5:
- https://marc.info/?l=openbsd-cvs&m=154723400730318
- 54e4f6b9a1

I am only removing the test from CI, not touching exported function from Rust libc to avoid a breaking change.
2019-01-14 17:49:14 +00:00
Jeremy Soller 84d3147354
Bump version to 0.2.47 2019-01-14 08:07:57 -07:00
bors 1329b13c98 Auto merge of #1207 - redox-os:redox, r=gnzlbg
Redox module update

This adds poll, mmap, and stat support
2019-01-14 09:25:51 +00:00
Jeremy Soller d4d3ef379c
Add more types 2019-01-13 16:48:45 -07:00
Jeremy Soller 3a5ec3f91e
Fix style 2019-01-13 15:51:21 -07:00
Jeremy Soller 443b401dac
Add poll and mmap support 2019-01-13 14:46:30 -07:00
bors ab67803a55 Auto merge of #1205 - alecmocatta:master, r=gnzlbg
Comment FIOSEEK* until they're in a NetBSD release

Accidentally included two constants that aren't in the current release of NetBSD.

While this doesn't impact libc-consumers, failing the testsuite on latest NetBSD isn't ideal.

I've commented them out; they can be reintroduced when the next NetBSD ships with them included.
2019-01-13 11:31:33 +00:00
Sébastien Marie 1451f19067 mincore has been removed from OpenBSD 6.5 2019-01-13 09:06:05 +01:00
alecmocatta b8efb9c3ba
Rectify line length 2019-01-13 00:15:51 +00:00
alecmocatta de64c557ae
Fix https://github.com/rust-lang/libc/pull/1200#issuecomment-453712616 2019-01-12 17:19:43 +00:00
bors 8bb09e2353 Auto merge of #1202 - acfoltzer:greg-offsets, r=alexcrichton
glibc x86: add the register offset constants for mcontext_t.gregs

Constants calculated from the [glibc source](https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86/sys/ucontext.h;h=3d883c2bf1220ef50cedc6b1491d699c0727c508;hb=HEAD). These are needed when using `mcontext_t`. Thanks!
2019-01-11 02:43:34 +00:00
bors 86a091c015 Auto merge of #1200 - alecmocatta:master, r=alexcrichton
add FIO* for FreeBSD and NetBSD

Calculated [here](https://repl.it/repls/PaltryTroubledMonitors) from FreeBSD [source](9867e6d8fe/sys/sys/filio.h).

Calculated [here](https://repl.it/repls/ProfitableImpracticalComputeranimation) from NetBSD [source](64b8a48e12/sys/sys/filio.h).

Some of these are likely identical across all BSDs – if this can be confirmed they could be elevated to `unix/bsd/mod.rs` alongside `FIOCLEX` and `FIONBIO`.
2019-01-11 02:14:56 +00:00
bors c3c5e9cd05 Auto merge of #1199 - inferiorhumanorgans:iho/dfbsd-ioctl_compat_h, r=alexcrichton
Remove sys/ioctl_compat.h from DragonFlyBSD tests.

Per the mailing list[1], sys/ioctl_compat.h has been removed.  This should fix #1198.

1: http://lists.dragonflybsd.org/pipermail/commits/2018-April/672079.html
2019-01-11 01:44:19 +00:00
Adam C. Foltzer 696b8b7ee5
fix typo in x86 register constants 2019-01-09 13:30:14 -08:00
Adam C. Foltzer ae06c2b2ae
glibc x86: add the register offset constants for mcontext_t.gregs 2019-01-09 11:56:20 -08:00
Andrei-Marius Radu 3ecdcff488 Remove fexecve from netbsdlike as it's not implemented
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
2019-01-09 18:59:34 +02:00
alecmocatta f97d3c46f5
add FIO* for netbsd 2019-01-08 19:24:14 +00:00
alecmocatta 6ce007f291
add FIO* for freebsd 2019-01-08 12:21:46 +00:00
Alex Zepeda 5a3a0c2a95 Remove sys/ioctl_compat.h from DragonFlyBSD tests.
Per the mailing list[1], sys/ioctl_compat.h has been removed.

1: http://lists.dragonflybsd.org/pipermail/commits/2018-April/672079.html
2019-01-03 21:09:15 -08:00
bors 22b08f8eed Auto merge of #1196 - asomers:uname_freebsd, r=alexcrichton
Fix uname on FreeBSD

On FreeBSD, uname is an inline function.  The uname that is present in
libc.so is for FreeBSD 1.0 compatibility.  It expects a buffer of a
different size.

Fixes #1190
Reported-by: Alex Zepeda
2019-01-03 20:30:55 +00:00
Alan Somers 36baf9323d Fix uname on FreeBSD
On FreeBSD, uname is an inline function.  The uname that is present in
libc.so is for FreeBSD 1.0 compatibility.  It expects a buffer of a
different size.

Fixes #1190
Reported-by: Alex Zepeda
2019-01-03 08:53:50 -07:00
bors a9e3cc6c1b Auto merge of #1195 - glaubitz:new-release, r=alexcrichton
Bump version to 0.2.46

New release required for https://github.com/rust-lang/rust/pull/57121
2019-01-03 01:51:19 +00:00
John Paul Adrian Glaubitz 11d1a181d2 Bump version to 0.2.46 2019-01-02 21:00:19 +01:00
bors 67fd35d0f3 Auto merge of #1193 - alexcrichton:test, r=alexcrichton
Test out new bors integration

See if it works with Cirrus CI!
2019-01-02 18:45:17 +00:00
Alex Crichton 09c4c2345b Test out new bors integration
See if it works with Cirrus CI!
2019-01-02 10:27:19 -08:00
Alex Crichton 1650b395ae
Merge pull request #1191 from asomers/cirrus_badge
[skip ci] Add a Cirrus-ci.com build badge
2019-01-02 11:55:01 -06:00
bors b2f7699394 Auto merge of #1189 - pusateri:recvdstaddr, r=alexcrichton
Add IP_RECVDSTADDR on netbsd.

Accidentally left out IP_RECVDSTADDR on NetBSD in #1184
2019-01-02 16:29:16 +00:00