Commit graph

529 commits

Author SHA1 Message Date
Yuki Okushi 05c4574f3a
Declare utmpx on musl 2020-07-22 09:51:21 +09:00
Stefano Garzarella 45db822a18 Skip test for "VMADDR_CID_RESERVED" and "VMADDR_CID_LOCAL"
VMADDR_CID_RESERVED is NOT available from Linux v5.6.
VMADDR_CID_LOCAL is available only on Linux >= v5.6.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-07-20 21:33:02 +02:00
Simonas Kazlauskas 91fee24f12
Move the SEAL constants to freebsd12 module 2020-07-20 01:16:47 +09:00
Simonas Kazlauskas 6b14cfbf93
Add some missing fcntl flags for freebsd 2020-07-20 01:14:26 +09:00
Patrick Mooney e1b9757128 Expose EPOLLEXCLUSIVE on illumos platform
Initially the EPOLLEXCLUSIVE definition was hidden on the illumos
platform as it lacked explicit support.  After further review, it was
concluded that EPOLLEXCLUSIVE can safely be considered a no-op, when not
fully implemented by the OS, making it safe for use on illumos.
2020-07-17 18:28:33 +00:00
Yuki Okushi 0c2027f05a
Merge pull request #1811 from sunfishcode/wasi-more
Add more WASI libc definitions.
2020-07-07 07:04:08 +09:00
Dan Gohman 753ad8205f Add more WASI libc definitions.
This adds various WASI libc definitions to the Rust libc bindings that I
needed while porting some applications to WASI.

It also removes the `pause` binding since newer versions of WASI libc
have removed this function as well. (WASI currently has no syscall with
this functionality.)
2020-07-06 05:50:17 -07:00
Greg V 9fc2574548 FreeBSD: chase CTL_UNSPEC to CTL_SYSCTL, IPPROTO_SEP to IPPROTO_DCCP renames
Plus, add new constants for sysctls that give names to existing magic numbers.

https://reviews.freebsd.org/rS350749
https://reviews.freebsd.org/rS352486
2020-07-06 15:31:37 +03:00
Greg V 1e66be9c45 FreeBSD: add ucontext.h to libc-test
It was picked up transitively on >10, but tests failed on 10
2020-07-06 15:31:37 +03:00
Andrew Walbran 51acd7f488 Android: Add various constants and functions.
In particular:
Add timerfd constants and functions, from sys/timerfd.h.
Add EFD_SEMAPHORE and group all EFD_ constants together.
Add sigtimedwait function, from signal.h.
Add missing fallocate constants and functions, from linux/falloc.h and fcntl.h.
Add xattr functions, from sys/xattr.h.
Add SCHED_ and SEEK_ constants, from linux/sched.h and bits/seek_constants.h.
Add rlimit functions, from sys/resource.h.
Add RENAME_ constants, from stdio.h.
Add ino64_t type, from sys/types.h.
2020-06-30 17:56:11 +01:00
Yuki Okushi b6396caf31
Merge pull request #1792 from jasonbking/cmsg 2020-06-27 19:17:32 +09:00
Jason King 40c46f4306 Add ancillary socket data accessor functions for solarish OSes 2020-06-26 20:58:43 +00:00
Simon Wörner 4a9413ba54 added freebsd register structs 2020-06-22 17:33:09 +02:00
Patrick Mooney b53ccb8740 illumos: Add eventfd support 2020-06-09 20:57:33 +00:00
Yuki Okushi c6fb0f37ad
Run rustfmt 2020-06-02 20:37:34 +09:00
Yuki Okushi a6920f9a5a
Use ctest2 to drop old dependencies 2020-06-02 01:10:08 +09:00
Yuki Okushi 8d3cc4b527
Update FIXME comment 2020-05-23 12:32:55 +09:00
Yuki Okushi f8f9a8e6f6
Merge pull request #1768 from Erk-/freebsd-getnameinfo-flags
[FreeBSD] Add missing getnameinfo() flag values.
2020-05-22 00:16:19 +09:00
Valdemar Erk 5fec4c3691 [FreeBSD] Add missing getnameinfo() flag values.
This patchs adds missing flag values for getnameinfo()
on FreeBSD, the following flags have been added from
the FreeBSD tree.

 /*
  * Flag values for getnameinfo()
  */
 #define	NI_NOFQDN	0x00000001
 #define	NI_NUMERICHOST	0x00000002
 #define	NI_NAMEREQD	0x00000004
 #define	NI_NUMERICSERV	0x00000008
 #define	NI_DGRAM	0x00000010
 #define	NI_NUMERICSCOPE	0x00000020

Signed-off-by: Valdemar Erk <valdemar@erk.io>
2020-05-21 14:38:13 +02:00
Yuki Okushi 1528539b0a
Ignore fns that have suddenly disappeared on Android CI 2020-05-21 15:29:10 +09:00
Yuki Okushi b12c35f0cd
Skip test for mode field of ipc_perm 2020-04-30 14:27:59 +09:00
Yuki Okushi b05f659361
Skip some items changed in glibc 2.31 2020-04-21 12:18:40 +09:00
Yuki Okushi e69c5eaa9f
Merge pull request #1734 from JohnTitor/docs
Minor clean-up CI docs
2020-04-14 09:04:42 +09:00
Yuki Okushi 1ef129b210
Minor clean-up CI docs 2020-04-14 03:23:50 +09:00
Yuki Okushi 622e6f5d25
Update node to v12.16.2 2020-04-14 02:48:35 +09:00
Yuki Okushi 991678ce0b
Skip test for SYS_gettid 2020-04-14 02:48:35 +09:00
Alexander Batischev fda521b9d2 Add bindings for POSIX regexes
Headers I used:

Oh, for reference, here are the headers I used while working on this:

- musl: https://git.musl-libc.org/cgit/musl/tree/include/regex.h?id=8327ae0cb23b799bc55a45e0d4bd95f5a2b1cdf1
- glibc: https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/regex.h;h=87cce7f5cb8cc3b678467329b479bd511e250e61;hb=HEAD
- macOS: https://opensource.apple.com/source/Libc/Libc-997.90.3/include/regex.h.auto.html
- FreeBSD: 8103b0ddb0/include/regex.h
- NetBSD: 61c8f6fbb7/include/regex.h
2020-04-13 15:57:58 +03:00
Yuki Okushi 27f89544a8
Run rustfmt 2020-04-11 22:13:58 +09:00
Yuki Okushi 9782b7ff8f
Merge pull request #1716 from pfmooney/illumos-target
Split up Solaris and illumos targets
2020-04-11 19:09:29 +09:00
Guillume DIDIER c646f96fdf This adds the defines from include/uapi/asm-generic/hugetlb_encode.h and the corresponding defines in include/uapi/linux/mman.h to linux_like/linux/gnu/mod.rs and the equivalent for musl in linux_like/linux/musl/mod.rs
Solves #1700

Removes two defines from musl/b32/hexagon.rs that are now provided two mudules "up"
2020-04-09 18:10:27 +02:00
Daniel McCarney 5c7a82a1c8 linux: add fanotify(7) API bindings.
The `fanotify` API[0] is a linux-specific API for notification and interception
of filesystem events. In some ways it is similar to `inotify`, but with
different advantages/tradeoffs. It is particularly well suited to full
filesystem/mount monitoring (vs per directory) and for allowing/denying access
to files (`inotify` lacks this capability).

The `fanotify` API has been updated several times since it was enabled in Linux
2.6.37. Presently I've only included support for the original `fanotify`
features, and the `FAN_MARK_FILESYSTEM` addition made in Linux 4.20. There are
subsequent updates in 5.0 and 5.1 not covered in this initial commit.

This commit adds the relevant constants and types from
`uapi/linux/fanotify.h`[1] and two new functions (`fanotify_init`[2] and
`fanotify_wrap`[3]) to `src/unix/linux_like/linux/mod.rs`. While I believe this
API is also present on Android I have presently limited my attention to Linux.

Although this commit focuses on Linux 4.20.x's `fanotify` API/constants I have
skipped adding constants for `FAN_ALL_CLASS_BITS`, `FAN_ALL_INIT_FLAGS`,
`FAN_ALL_MARK_FLAGS`, `FAN_ALL_EVENTS`, `FAN_ALL_PERM_EVENTS` and
`FAN_ALL_OUTGOING_EVENTS` even though they are present in this kernel version's
headers. These defines were deprecated[4] in later releases with instructions to
not use them in new programs or extend them with new values. It would be a shame
for new Rust programs to use deprecated #defines!

[0]: http://man7.org/linux/man-pages/man7/fanotify.7.html
[1]: d54f4fba88/include/uapi/linux/fanotify.h
[2]: http://man7.org/linux/man-pages/man2/fanotify_init.2.html
[3]: http://man7.org/linux/man-pages/man2/fanotify_mark.2.html
[4]: 23c9deeb32 (diff-4c9ca62be6bf38cc08f7ea9daf16e379)
2020-04-04 16:07:09 -04:00
Patrick Mooney 48594dc7c1 Update ctest for illumos and Solaris 2020-04-03 13:16:58 +00:00
Yuki Okushi 52270b06e2
Enable s390x-unknown-linux-gnu on CI 2020-03-15 15:10:50 +09:00
John Baublitz 47c0d4ae81 Add constants from linux/keyctl.h 2020-03-09 11:00:46 -04:00
zonyitoo 47e2f8b922 Add IP6T_SO_ORIGINAL_DST definition 2020-03-08 18:31:25 +08:00
Daniel Fox Franke 51f1aa42c0 Add <sys/timex.h> declarations for Solaris/IllumOS 2020-03-01 14:23:07 -05:00
Daniel Fox Franke b2740e263d Add <sys/timex.h> declarations for Linux 2020-03-01 13:35:39 -05:00
Daniel Fox Franke 2fe7865372 Include <sys/timex.h> in libc-test 2020-03-01 11:45:33 -05:00
Michal 'vorner' Vaner 35db4e45c7
Nfnetfilter queue constants
Constants for the linux nfqueue netlink protocol (userspace firewall).

Continuation of #1562 and #1571.
2020-03-01 12:43:33 +01:00
Yuki Okushi 9f9a5edcee Skip some items changed in Catalina 2020-03-01 00:19:09 +09:00
Yuji Yamamoto 338dd7c085
Add ucontext.h to test target 2020-02-28 15:59:48 +09:00
Yuki Okushi 72448d2885 Skip statx and statx_timestamp for now 2020-02-25 16:44:21 +09:00
Yuki Okushi 804a11dc89 Ignore sys/io.h on gnuabihf 2020-02-25 16:44:21 +09:00
Yuki Okushi f77dcc4811 Ignore deprecated header file in gnu 2020-02-25 14:46:21 +09:00
BaoshanPang e2eb0a6e5e add functions for message queue 2020-02-24 10:02:02 -08:00
Vickenty Fesunov 9358be36d6 Remove unnecessary parenthesis
This triggers a warning on a recent nightly, which in turn breaks CI due to
`#![deny(warnings)]` in libc-test/build.rs
2020-02-12 10:09:22 +01:00
bors a3c5f9b72c Auto merge of #1616 - mcpherrinm:withandroid, r=gnzlbg
Add sock_extended_err and associated constants from errqueue.h to linux_like

This is an alternate version of #1614 that attempts to fix issues with the android ctests by rearranging the headers.  Due to long CI cycle time, I've opened it as an alternate PR.  Only one or the other should merge, depending if linux_like or linux is the correct place for this.

sock_extended_err is a struct returned as a control message when the sockopt
IP_RECVERR is set, when recvmsg has the MSG_ERRQUEUE flag set. IP_RECVERR and
MSG_ERRQUEUE are constants both already defined here.
2019-12-23 11:58:51 +00:00
Alex Crichton 93743ca839 Update bindings for the wasm32-wasi target
This commit performs a number of updates for libc with the `wasm32-wasi`
target:

* Updates the `wasi-libc` repository commit used (previously known as
  `wasi-sysroot`)
* Updates the container to Ubuntu 19.10 which has Clang 9 packaged which
  is all we need.
* Avoids building `wasmtime` and instead downloads a precompiled binary.
* Updates bindings in `src/wasi.rs` to match the current upstream state.
2019-12-16 07:57:52 -08:00
Matthew McPherrin 06938add2d Add test for SO_EE_OFFENDER
Modelled after the cmsg tests, this wraps the C macro into a function, and then
compares the results to the Rust implementation in libc.
2019-12-02 17:02:23 -08:00
Matthew McPherrin a9a6ef13a1 rustfmt build.rs 2019-12-02 10:35:40 -08:00
Matthew McPherrin d1a404c5ad Missing errqueue.h in android 2019-12-02 01:25:50 -08:00
Matthew McPherrin 73c243700c Add sock_extended_err and associated constants from errqueue.h
sock_extended_err is a struct returned as a control message when the sockopt
IP_RECVERR is set, when recvmsg has the MSG_ERRQUEUE flag set.  IP_RECVERR and
MSG_ERRQUEUE are constants both already defined here.
2019-12-02 01:06:43 -08:00
Matthew McPherrin 104a3f2aba Move linux/ headers down in test_android
This moves the linux/ headers after others
This keeps the Android tests closer to the Linux ones.
I think this is needed to get linux/errqueue.h to not cause compilation
failures.
2019-12-02 01:01:52 -08:00
bors 122ca908ee Auto merge of #1578 - fatpelt:master, r=gnzlbg
- add ssm struct and setsockopt constants

Signed-off-by: patrick felt <patrick.felt@sling.com>
2019-11-25 12:13:04 +00:00
bors 7f33bcb399 Auto merge of #1561 - elichai:2019-10-flock64, r=gnzlbg
Add flock64 to linux_like platforms

Hi,
I'm not sure about what to make of the ifdef in glibc `__USE_LARGEFILE64` that covers it.
but I copied the impl from glibc's headers.
everything is the same except for sparc which has a reserved short int.
and in musl it's just `#define flock64 flock`
2019-11-25 09:55:59 +00:00
Elichai Turkel 490e073525
Fix wording in the build script flock64 rule
Co-Authored-By: gnzlbg <gnzlbg@users.noreply.github.com>
2019-11-25 11:33:21 +02:00
patrick felt 2cb9eec131 - skip the roundtrip c check due to alignment
Signed-off-by: patrick felt <patrick.felt@sling.com>
2019-11-21 17:02:26 -07:00
Elichai Turkel 66529ed375
Add a rule for flock64 in libc-test build script 2019-11-21 23:41:54 +02:00
bors 2d94f3f373 Auto merge of #1588 - oxalica:upgrade-musl, r=gnzlbg
Upgrade to musl 1.1.24 in CI

Required by #1577

Note that in musl 1.1.24, `struct sched_param` from `sched.h` has changed and some fields became reserved. So [these fields](13d4a5da2e/src/unix/linux_like/mod.rs (L97)) are outdated. I'm not sure if we should rename them, since they are in public API.

I simply skip `struct sched_param` from the test now.

Here's the diff between musl 1.1.23 and 1.1.24
```
diff --git a/include/sched.h b/include/sched.h
index 05d40b1e..7e470d3a 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -18,10 +18,12 @@ extern "C" {

 struct sched_param {
        int sched_priority;
-       int sched_ss_low_priority;
-       struct timespec sched_ss_repl_period;
-       struct timespec sched_ss_init_budget;
-       int sched_ss_max_repl;
+       int __reserved1;
+       struct {
+               time_t __reserved1;
+               long __reserved2;
+       } __reserved2[2];
+       int __reserved3;
 };
```
2019-11-21 20:34:40 +00:00
bors 51e047c586 Auto merge of #1571 - vorner:nfnetfilter-log, r=gnzlbg
Nfnetfilter log

This adds the constants from linux/netfilter/nfnetlink.h and nfnetlink_log.h. These are the files I need for https://github.com/jbaublitz/neli/pull/48. After this gets in, I'd like to follow-up with the other nfnetlink_*.h files too, as I'd like to extend neli with further protocols in the future, but I want to do a smaller PR first to see if there are some things to tweak.

I've noticed similar netfilter constants are also in the android subfolder, therefore I'm adding them there too (I don't like the copy-pasting, but it seems the other ones are already copy-pasted). I assume the test will catch it if anything is different on that platform.
2019-11-20 09:38:07 +00:00
oxalica b14e947de3
Upgrade to musl 1.1.24 in CI 2019-11-19 14:17:34 +08:00
Sébastien Marie 487b454d9f add shm support for NetBSD and OpenBSD
initial work from @landryb for OpenBSD, various fixes and NetBSD support from me.

Fixes #1585
2019-11-07 13:10:04 +01:00
Michal 'vorner' Vaner 2216488714
nfnetlink & nfnetlink_log constants
First batch for #1562
2019-10-28 09:58:03 +01:00
BaoshanPang d1a37cbcd6 Support vxWorks in libc-test 2019-10-11 09:47:45 -07:00
gnzlbg 9b97095acc Skip max_align_t in FreeBSD10 2019-09-21 14:45:07 +02:00
bors 58b2706e75 Auto merge of #1518 - gnzlbg:freebsd10support, r=gnzlbg
Add FreeBSD10 support

This adds libc-test support for Freebsd10 and a CI build job that tests
FreeBSD10 with LIBC_CI only.

cc @asomers this is a follow up to #1491 .
2019-09-21 09:34:21 +00:00
gnzlbg 974f550e1c Implement max_align_t 2019-09-20 17:17:22 +02:00
gnzlbg e7bcb7aff2 Re-enable all roundtrip tests 2019-09-19 16:20:33 +02:00
gnzlbg 3843c7dba1 Add FreeBSD10 support
This adds libc-test support for Freebsd10 and a CI build job that tests
FreeBSD10 with LIBC_CI only.
2019-09-16 20:50:55 +02:00
Sébastien Marie 3b7be3c193 adapt ioctl() BPF for OpenBSD 2019-08-18 10:19:49 +02:00
bors 245b0f891b Auto merge of #1440 - pizzamig:invert-freebsd12, r=gnzlbg
Add support for FreeBSD CURRENT (aka freebsd13)

Using the last FreeBSD-CURRENT (development snapshot) the libc build, but tests fail.
This patch detects and supports FreeBSD CURRENT as freebsd13, and reworks the conditional compilation to use the `freebsd11` attribute instead of `not(freebsd12)`
For now, freebsd13 is reusing all freebsd12 definitions, except for `ELAST`
While here, add a new `errno`introduced in freebsd13
2019-08-10 16:38:46 +00:00
bors a2b48d16f7 Auto merge of #1456 - semarie:openbsd-roundtrip, r=gnzlbg
skip roundtrip on few structs on OpenBSD

skip roundtrip on some structs on OpenBSD. it is mostly the same than other targets: dirent, utsname, utmp.
2019-08-09 12:50:55 +00:00
Luca Pizzamiglio 154e58dd12 Fix format 2019-08-09 13:54:21 +02:00
Sébastien Marie 04c7f1166c skip roundtrip on few struct on OpenBSD 2019-08-05 09:14:42 +02:00
Luca Pizzamiglio 64bc745405 Properly define freebsd11 attribute 2019-07-28 23:00:53 +02:00
Luca Pizzamiglio 4a74f1e0df Add support for FreeBSD CURRENT (aka freebsd13)
Currently, libc supports and detects freebsd11 and freebsd13
Unknown versions, like freebsd13, is treated as freebsd11.
This patch solve the issues, detecting freebsd13 and treating it like
freebsd12.
Inverting the logic not(freebsd12) -> freebsd11 where possible
2019-07-28 23:00:53 +02:00
gnzlbg 6ca5bfaea1 Setup Azure Pipelines 2019-07-27 13:25:22 +02:00
bors 789c38144e Auto merge of #1423 - Susurrus:issue_665, r=gnzlbg
Remove AF_MAX, PF_MAX, NET_MAXID constants

These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.

Closes rust-lang/libc#665
2019-07-06 16:47:40 +00:00
gnzlbg b2dcd5c76a Fix x86_64 musl 2019-07-05 18:24:16 +02:00
gnzlbg 7fa6534858 Fix FreeBSD and Appveyor 2019-07-05 18:13:03 +02:00
gnzlbg 3fd4dd7ea3 Silence roundtrip errors 2019-07-05 18:13:03 +02:00
gnzlbg b81a234913 Silence roundtrip in linux 2019-07-05 18:13:03 +02:00
Bryant Mairs 215f095601 Remove AF_MAX, PF_MAX, NET_MAXID constants
These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.

Closes rust-lang/libc#665
2019-07-05 07:39:00 -07:00
gnzlbg 5e3866ad56 Update ctest version 2019-07-03 13:00:03 +02:00
Adam C. Foltzer 339fe22653
add fixmes for the ucontext_t shadow stack field 2019-06-27 09:32:52 -07:00
Adam C. Foltzer 886bb3f2f8
filter out the struct test rather than removing the header 2019-06-26 16:56:53 -07:00
Adam C. Foltzer dba4138305
remove newer __ssp field from ucontext_t for earlier glib compat
Per discussion in #1410, this is necessary to avoid struct size mismatches between Rust and C on
systems with glibc < 2.28.
2019-06-26 15:52:56 -07:00
Stefano Garzarella 4825678dee libc-test: include "linux/vm_sockets.h" to test VSOCK
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2019-06-05 11:44:42 +02:00
gnzlbg bf1ab2b6a1 CI sparc64 glibc version does not have statx 2019-05-29 14:57:56 +02:00
bors c9fbd00633 Auto merge of #1372 - tklauser:f-seal-future-write, r=gnzlbg
Add F_SEAL_FUTURE_WRITE on Linux/Android

This was added in Linux 5.1 and will only show up in the next glibc
release, thus skip in tests.
2019-05-28 17:18:53 +00:00
Tobias Klauser 73643694b3 Add F_SEAL_FUTURE_WRITE on Linux/Android
This was added in Linux 5.1 and will only show up in the next glibc
release, thus skip in tests.
2019-05-28 16:33:01 +02:00
gnzlbg 484f39e1ba Document SIGUNUSED deprecation on Android 2019-05-28 16:21:18 +02:00
gnzlbg 8e26ab4964 Minor nitpicks 2019-05-28 16:21:18 +02:00
gnzlbg 0bc18a5dc9 [breaking change] sendmmsg/recvmmsg have incorrect signature c_int vs c_uint on emscripten 2019-05-28 16:01:26 +02:00
gnzlbg 5ede8aab94 Enable disabled tests 2019-05-28 16:01:26 +02:00
gnzlbg 1a3d1525da [breaking change] sendmmsg/recvmmsg flag argument is an unsigned integer on MUSL 2019-05-28 10:09:43 +02:00
gnzlbg 2543b7c8ed bump kernel headers to 4.4.2-2 2019-05-27 22:23:02 +02:00
gnzlbg 1cbc523e50 [breaking change] MADV_SOFT_OFFLINE is undefined on MIPS 2019-05-27 22:23:02 +02:00
gnzlbg 8f403e5ac2 Update MUSL Linux kernel headers and re-enable Linux tests 2019-05-27 22:23:02 +02:00
gnzlbg 7437d0a6f1 Add a FreeBSD 12 build job and test FreeBSD12 APIs
This commits adds a second FreeBSD 12 build job,
and splits the implementation of the FreeBSD module
into two modules, one for FreeBSD 11, and one for FreeBSD 12.

The FreeBSD 11 module is compiled always by default, and is
mostly forward compatible with FreeBSD 12 systems.

The FreeBSD 12 module is only built for now in libc's CI,
and uses FreeBSD 12 data types and APIs, linking to symbols
that are only available in FreeBSD 12.

Basically, when LIBC_CI env variable is defined, and the host
system is a FreeBSD 12 system, then the FreeBSD 12 module is
automatically built and tested. Conditional compilation is done
using a `cfg(freebsd12)` flag.

This commit also re-enables many tests, and documents why
some remain disabled.
2019-05-24 20:04:17 +02:00
bors f775bea997 Auto merge of #1344 - gnzlbg:fix_android_bj, r=gnzlbg
Fix Android build jobs
2019-05-23 18:12:55 +00:00
gnzlbg ccad8b426c Fix musl build jobs 2019-05-23 19:09:39 +02:00
gnzlbg 7f8b946cc2 Document what is wrong with sighandler_t 2019-05-23 16:31:05 +02:00
gnzlbg 3efe23b1c0 Enable more tests on Android 2019-05-23 16:30:51 +02:00
gnzlbg 30c853f59f [breaking change] remove __progname 2019-05-23 16:30:51 +02:00
gnzlbg 8c70f498f2 Enable more tests (some related to issue 1272) on Android 2019-05-23 16:30:36 +02:00
gnzlbg d52732581a Test strerror_r on Android and Linux 2019-05-23 16:29:28 +02:00
gnzlbg 003c04d952 [breaking change] fix types of stat/stat64 structs, atime/mtime/ctime fields on Android 2019-05-23 16:29:28 +02:00
gnzlbg 4774fc1c9f Deprecate ENOATTR on Linux and Android 2019-05-23 16:29:28 +02:00
gnzlbg eea0102308 Enable more tests on Android 2019-05-23 16:29:08 +02:00
bors d14bbca96b Auto merge of #1351 - jbaublitz:nl_consts_pr, r=gnzlbg
Netlink constants for use with the route netlink subsystem

Reopening a PR to close #1059. I'll be adding a few more constants but want to make sure CI works on Github first.
2019-05-22 19:30:03 +00:00
gnzlbg 7b45788a01 Refactor OpenBSD-like module into OpenBSD 2019-05-22 14:20:13 +02:00
gnzlbg 759c837611 [breaking change] incorrect API of gettimeofday
The second argument of `gettimeofday` was a `*mut c_void` on all targets,
but that type is incorrect in the following targets, where it should be
a `*mut timezone` instead:

On these other targets it appears that the signature of gettimeofday was incorrect (it takes a time-zone pointer instead of a void pointer):

linux+gnu: http://man7.org/linux/man-pages/man2/gettimeofday.2.html
freebsd: https://www.freebsd.org/cgi/man.cgi?query=gettimeofday&apropos=0&sektion=2&manpath=FreeBSD+11.2-stable&arch=default&format=html
openbsd: https://man.openbsd.org/gettimeofday.2
android: https://github.com/ricardoquesada/android-ndk/blob/master/usr/include/sys/time.h
dragonfly: https://www.dragonflybsd.org/cgi/web-man?command=gettimeofday&section=2

This commit corrects the type on these targets, which is a breaking change. Due
to how this API is commonly used (e.g. passing `ptr::null_mut` to the second
argument), breakage should be minimal. Users wanting to support both versions
can just write `ptr as *mut _` instead.

Closes #1338.
2019-05-22 10:39:06 +02:00
John Baublitz f70a98773c Fix builds by adding trailing commas 2019-05-21 13:18:22 -04:00
John Baublitz e39ed74cd9 Fix builds by including linux/rtnetlink.h and linux/if_addr.h 2019-05-21 10:14:24 -04:00
bors 6bc42d40e5 Auto merge of #1342 - sunfishcode:master, r=gnzlbg
Update to the latest wasi-sysroot.

 - Rename `wasm32-unknown-wasi` to `wasm32-wasi`.
 - `__wasilibc_rmfileat` was renamed to `__wasilibc_unlinkat`
 - Add bindings for a few more functions and typedefs.
2019-05-16 21:51:36 +00:00
Linus Färnstrand 72463fc155 Add futex.h to test 2019-05-16 20:40:18 +02:00
Dan Gohman 215cd1549e Update to the latest wasi-sysroot.
- Rename `wasm32-unknown-wasi` to `wasm32-wasi`.
 - `__wasilibc_rmfileat` was renamed to `__wasilibc_unlinkat`
 - Add bindings for a few more functions and typedefs.
2019-05-16 06:40:50 -07:00
gnzlbg 9183c00f7e Remove unecessarily disabling a warning on FreeBSD 2019-05-16 11:03:12 +02:00
gnzlbg 9df115b67f Update Ubuntu images to 19.04 2019-05-16 09:15:12 +02:00
gnzlbg 1a7ee21aec Define DEPRECATED_SCANF macro to use older scanf,sscanf,fscanf symbols 2019-05-16 09:15:12 +02:00
gnzlbg 4aa5a45af1 Correct assert for mips+musl 2019-05-16 09:15:12 +02:00
gnzlbg be36f6859b execinfo not available in emscripten 2019-05-16 09:15:12 +02:00
gnzlbg bf76ded067 Test the Elf32/64 types sperately
These types have a p_types field, but the resolv.h
header defines p_types __p_types macro that breaks them.
2019-05-16 09:15:11 +02:00
gnzlbg f67f831aad readd netfilter headers 2019-05-16 09:15:11 +02:00
gnzlbg 352ee1c37d Include Linux headers after sys headers 2019-05-16 09:15:11 +02:00
gnzlbg cb3a9db378 Include aio.h as the last header 2019-05-16 09:15:11 +02:00
gnzlbg 54fcb89354 Add missing sysctl header to freebsd tests 2019-05-16 09:15:11 +02:00
gnzlbg 9da2fd5ace Add missing utmpx.h header to freebsd tests 2019-05-16 09:15:11 +02:00
gnzlbg dc7311bec7 Include aio.h before sys/mount.h on linux 2019-05-16 09:15:11 +02:00
gnzlbg 426f91bd25 Fix typo in Linux checking 2019-05-16 09:15:11 +02:00
gnzlbg bb2f29641a Add missing netinet/ip.h header 2019-05-16 09:15:11 +02:00
gnzlbg 0f96e543b1 Remove conflicting linux/netfilter_ipv6.h header file due to conflicting definitions 2019-05-16 09:15:11 +02:00
gnzlbg bee2611368 Remove conflicting linux/netfilter_ipv4.h header file due to conflicting definitions 2019-05-16 09:15:11 +02:00
gnzlbg 3956bf056b Skip verification of gettimeofday on FreeBSD 2019-05-16 09:15:11 +02:00
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