diff options
author | gnzlbg <gonzalobg88@gmail.com> | 2019-02-22 14:10:52 +0100 |
---|---|---|
committer | gnzlbg <gonzalobg88@gmail.com> | 2019-02-22 19:18:02 +0100 |
commit | f5cbdbc2b945dbb7702d2dfbee62e4b70559fd99 (patch) | |
tree | 4950ebf05330f0f405898a080a2fd585e5c6e2bd /src/unix/haiku | |
parent | 8c571e0ce930d726322a0b02e69f5dc0b8b9ca74 (diff) | |
download | rust-libc-f5cbdbc2b945dbb7702d2dfbee62e4b70559fd99.tar.gz |
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.
Diffstat (limited to 'src/unix/haiku')
-rw-r--r-- | src/unix/haiku/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index d73967781b..c9050ba145 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -1111,6 +1111,12 @@ extern { #[link(name = "bsd")] extern { + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, + pshared: ::c_int, + value: ::c_uint) + -> ::c_int; + pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int; pub fn clock_settime(clk_id: ::c_int, tp: *const ::timespec) -> ::c_int; pub fn pthread_create(thread: *mut ::pthread_t, |