Commit Graph

337 Commits

Author SHA1 Message Date
gnzlbg
ac90c574e5 Refactor Linux target 2019-05-14 12:00:45 +02:00
gnzlbg
b976dc2055 Refactor FreeBSD target 2019-05-14 12:00:45 +02:00
gnzlbg
3c2284c435 Remove OpenBSD-related dead-code 2019-05-14 12:00:45 +02:00
gnzlbg
0af80cae53 Refactor Android target 2019-05-14 10:06:23 +02:00
Dan Gohman
ef7ae73239 Fix dirent to match WASI libc's definition.
dirent contains a flexible array member, so don't test its sizeof, don't
allow it to be copied, and don't represent it with an artificial size.
2019-04-23 15:03:23 -07:00
Dan Gohman
49c0dc98d0 Don't add "struct" to "DIR" or "fd_set". 2019-04-23 15:03:23 -07:00
Dan Gohman
3aa0188f1d Add headers for WASI to libc-test/build.rs 2019-04-23 15:03:23 -07:00
bors
363ba93ac4 Auto merge of #1314 - alexcrichton:wasi-ci, r=gnzlbg
Add binding for new `__wasilibc_find_relpath` API

This'll be used in libstd upstream, and this also enables wasi on CI!
2019-04-08 16:01:57 +00:00
Alex Crichton
cc0310146e Add binding for new __wasilibc_find_relpath API
Added recently and will be used in libstd!
2019-04-08 07:56:47 -07:00
Kevin Kuehler
03481551dd
add login_tty api from libutil 2019-04-05 14:26:08 -07:00
Alex Crichton
8662b47b27 Address some PR feedback 2019-03-27 11:21:44 -07:00
Alex Crichton
87def1fb80 Add intiial support for wasm32-unknown-wasi
This target is [being proposed][LINK] int he rust-lang/rust repository
and this is intended to get coupled with that proposal. The definitions
here all match the upstream reference-sysroot definitions and the
functions all match the reference sysroot as well. The linkage here is
described more in detail on the Rust PR itself, but in general it's
similar to musl.

Automatic verification has been implemented in the same manner as other
targets, and it's been used locally to develop this PR and catch errors
in the bindings already written (also to help match the evolving sysroot
of wasi). The verification isn't hooked up to CI yet though because
there is no wasi target distributed via rustup just yet, but once that's
done I'll file a follow-up PR to execute verification on CI.

[LINK]:
2019-03-27 09:24:48 -07:00
gnzlbg
0a9511eb21 Move inotify_event to the linux and android sub-modules 2019-03-25 19:43:58 +01:00
Sébastien Marie
917ff60a4b adjust PTHREAD_STACK_MIN to current value on OpenBSD
while here, generate the right file in test_openbsd()
2019-03-02 13:14:17 +01:00
bors
b905aef340 Auto merge of #1281 - semarie:openbsd-test, r=gnzlbg
cleanup libc-test for OpenBSD

here a cleanup for libc-test for OpenBSD

Some elements (compat for old and now unsupported OpenBSD versions) could be removed, but I think it is better to address them after this PR is merged.

the testsuite for OpenBSD still pass with it (well, with #1280)

r? @gnzlbg
2019-02-24 17:27:39 +00:00
Sébastien Marie
91748de469 cleanup libc-test for OpenBSD 2019-02-24 15:47:06 +01:00
gnzlbg
722b3e5337 Formatting 2019-02-24 15:14:02 +01:00
gnzlbg
70e0c4e877 Cleanup DragonflyBSD in libc-test/build.rs 2019-02-24 15:13:47 +01:00
gnzlbg
87f10ab9ee Cleanup NetBSD logic in libc-test/build.rs 2019-02-24 15:02:08 +01:00
gnzlbg
09afebe655 Clean up Redox, Solaris, and CloudABI 2019-02-24 14:38:01 +01:00
gnzlbg
0980cf593a Cleanup Windows libc-test build.rs 2019-02-24 13:11:14 +01:00
gnzlbg
f5cbdbc2b9 Clean libc-test for apple targets
This cleans up the build.rs of `libc-test` for apple targets.

I wanted to update the docker containers of some targets so that we can start
testing newer currently-skipped APIs properly, but it is impossible to figure
out which headers and APIs are skipped for each target.

This PR separates the testing of apple targets into its own self-contained
function. This allows seeing exactly which headers are included, and which items
are skipped. A lot of work will be required to separate the testing of all major
platforms and make the script reasonable.

During the clean up, I discovered that, at least for apple targets, deprecated
but not removed APIs are not tested. I re-enabled testing for those, and fixed
`daemon`, which was not properly linking its symbol. I also added the
`#[deprecated]` attribute to the `#[deprecated]` APIs of the apple targets. The
attribute is available since Rust 1.9.0 and the min. Rust version we support is
Rust 1.13.0.

Many other APIs are also currently not tested "because they are weird" which I
interpret as "the test failed for an unknown reason", as a consequence:

* the signatures of execv, execve, and execvp are incorrect (see
  https://github.com/rust-lang/libc/issues/1272)

* the `sig_t` type is called `sighandler_t` in libc for some reason:
  https://github.com/rust-lang/libc/issues/1273

This probably explains why some other things, like the
`sa_handler`/`sa_sigaction` fields of `sigaction` were skipped. The field is
actually a union, which can be either a `sig_t` for the `sa_handler` field, or
some other type for the `sa_sigaction` field, but because the distinction was
not made, the field was not checked.

The latest ctest version can check volatile pointers, so a couple of skipped
tests are now tested using this feature.
2019-02-22 19:18:02 +01:00
bors
577fdc86b2 Auto merge of #1248 - Ralith:flowinfo, r=gnzlbg
Expose IPV6_FLOWINFO* on Linux
2019-02-21 09:21:11 +00:00
bors
c2904a70fa Auto merge of #1261 - glebpom:master, r=gnzlbg
Add AF_ALG constants and structures
2019-02-20 08:43:11 +00:00
Gleb Pomykalov
34c96d74e1 Add comment on ALG_SET_AEAD_* exclusion 2019-02-19 18:14:01 +03:00
Gleb Pomykalov
d0f4c6e0fc Ignore ALG_SET_AEAD_* constants on MUSL tests 2019-02-19 16:35:25 +03:00
bors
0e1fbe33e9 Auto merge of #1257 - vi:ORIGDSTADDR, r=gnzlbg
Add IP_ORIGDSTADDR and others on FreeBSD.

A follow-up from #1252.

CC @asomers.

r? @gnzlbg
2019-02-18 16:00:56 +00:00
Gleb Pomykalov
32226f5d85 Include if_alg.h. Limit AF_ALG constants to only linux and android. 2019-02-18 18:19:29 +03:00
Vitaly _Vi Shukela
486de2ba2b
Ignore IP_ORIGDSTADDR in test for FreeBSD for now. 2019-02-14 02:37:01 +03:00
gnzlbg
c1e0a3f3b1 Always use the latest ctest 2019-02-12 18:34:56 +01:00
Benjamin Saunders
b59eb6b423 Expose IPV6_FLOW* on Linux 2019-02-08 12:50:25 -08:00
gnzlbg
0a5484ea72 Check style using rustfmt and reformat 2019-02-07 11:13:38 +01:00
Alan Somers
38cf5b15c6 Add an integration test for the cmsg(3) functions.
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
2019-02-05 08:26:17 -07:00
bors
942f6ae707 Auto merge of #1217 - Susurrus:rfc_2235, r=gnzlbg
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
2019-02-05 07:38:45 +00:00
Vincent Dagonneau
dfb7c0caba Added the proper libc header to libc-test; Removed some defines as they seem to be too new. 2019-02-04 09:11:21 +01:00
Bryant Mairs
868a85d05d Implement PartialEq,Eq for all types 2019-02-02 13:06:58 -08:00
Vincent Dagonneau
da27966859 Fixed typo; Added inotify headers to the libc-test. 2019-01-28 20:56:15 +01:00
Vincent Dagonneau
eb3e48c62f Added inotify headers to the libc-test. 2019-01-28 19:41:29 +01:00
gnzlbg
5a7b4e7796 MFD_HUGETLB does not appear to be available on x86_64-android 2019-01-21 20:34:43 +01:00
Sébastien Marie
1451f19067 mincore has been removed from OpenBSD 6.5 2019-01-13 09:06:05 +01: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
Mackenzie Clark
af19934f29 normalize to common name sighandler_t 2018-12-17 19:31:31 -08:00
Mackenzie Clark
4c32b9f4b9 move everything back into window mod with the type alias for msvc 2018-12-17 17:57:37 -08:00
Mackenzie Clark
2f25aaa235 add edge case for mingw 2018-12-17 17:24:37 -08:00
Mackenzie Clark
313483ba2e add signal and raise bindings
separate for gnu and msvc


scope resolve c_int

these types are not allowed, and more scope resolution


use size_t
2018-12-16 16:23:53 -08:00
Tobias Klauser
df277e295b Add MFD_HUGETLB const for linux
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-13 13:27:00 +01:00
Craig M. Brandenburg
6d22f54440 Add support for SysV semaphores on Apple platform 2018-12-08 06:50:19 -07:00
Tobias Klauser
cc22997fd2 Add AF_XDP, PF_XDP and SOL_XDP consts for linux 2018-12-04 21:04:13 +01:00
dependabot[bot]
406877e891
Bump ctest from 0.2.7 to 0.2.8
Bumps [ctest](https://github.com/alexcrichton/ctest) from 0.2.7 to 0.2.8.
- [Release notes](https://github.com/alexcrichton/ctest/releases)
- [Commits](https://github.com/alexcrichton/ctest/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-28 07:00:26 +00:00
bors
4113bf258d Auto merge of #1150 - rust-lang:dependabot/cargo/ctest-0.2.7, r=alexcrichton
Bump ctest from 0.2.6 to 0.2.7

Bumps [ctest](https://github.com/alexcrichton/ctest) from 0.2.6 to 0.2.7.
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/alexcrichton/ctest/commits/0.2.7)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=ctest&package-manager=cargo&previous-version=0.2.6&new-version=0.2.7)](https://dependabot.com/compatibility-score.html?dependency-name=ctest&package-manager=cargo&previous-version=0.2.6&new-version=0.2.7)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
2018-11-27 18:53:47 +00:00