Run s390x tests on qemu system
qemu in user mode cannot run binaries produced by rustc (it hangs), so we run the tests in a fully virtualized s390x machine using qemu-system-s390x.
Some constants had to be fixed.
Add sparc64-unknown-linux-gnu to CI (with disabled tests)
Tests are disabled because qemu segfaults, see https://github.com/rust-lang/libc/issues/822
The builder is still useful to catch some errors.
Fix kqueue filter consts type on NetBSD [WAS: Provide EV_SET]
Using BSD kqueue's `kevent` structure is tedious, because some BSD variants define the structure slightly differently. This forces user's code to differentiate between BSD variants and initialize `kevent` accordingly, which is annoying and error-prone.
For an example, refer to [MIO](https://github.com/carllerche/mio/blob/master/src/sys/unix/kqueue.rs#L38).
This is an attempt to fix it - provide a ctor function with the same signature across BSD variants.
Is an `impl` piece for a C structure allowed in libc?
**edit:** I noticed the `kevent` function has a similar problem, maybe I should include a fix for that too...
**edit:** ^ Done
Initial fixes for linux x32
Tested with a local build of rustc. The main test can be compiled but fails to execute (receives SIGTRAP, which I think in this case indicates memory violation, I will open an issue in the rustc repo).
This PR is important because it fixes the definition of `c_long` and `c_ulong`. Without these fixes, rustc crash with the error:
```
Cannot emit physreg copy instruction
UNREACHABLE executed at /checkout/src/llvm/lib/Target/X86/X86InstrInfo.cpp:5778!
```
Related https://github.com/rust-lang/rust/issues/37976
SYS_* constants are of type long in Android
The SYS_* constants should be `c_long` as `syscall` expect a `c_long` as first argument and in Android headers, there is no sign that these constants should be `unsigned long`.
So the compilation targeting ARM Android fails for dependent crates using `syscall`.
Introduce pthread_cancel() for terminating threads
pthread_cancel() is safer way to terminate thread than pthread_kill().
This function can be found from ISO/IEC 9945-1:1996 (“POSIX.1”) and first introduced into Single Unix Specification version 2 on 1997.
Add BOTHER & termios2 to Android & Linux
This should be the same for both the struct and the constant across all Linux/Android platforms, but we'll see!
Add more Linux-based syscall tables
* Add syscall tables to most remaining arches in `src/unix/notbsd`
* Add aarch64/arm musl to CI
* Update dependencies
pthread_cancel() is safer way to terminate thread than pthread_kill().
This function can be found from ISO/IEC 9945-1:1996 (“POSIX.1”) and
first introduced into Single Unix Specification version 2 on 1997.
Local peer credential support for FreeBSD.
FreeBSD uses SOL_SOCKET/LOCAL_PEERCRED instead of SOL_SOCKET/SO_PEERCRED parameters to getsocktopt to retrieve the credentials of a socket's peer.
(Documented in man 4 unix)