haiku: Add missing lutimes
* BeOS traditionally didn't have lutimes, however to make Haiku
more compatible and easier to port for, we added an implementation
of it.
These aren't exposed on non-MIPS musl targets, but since they're
part of a kernel API, they're still applicable, so we just don't
test them there but expose them anyways.
Add constants used by getrandom linux syscall
getrandom syscall was added in kernel 3.17. Musl and android seems to use old kernel headers, but considering that they define SYS_getrandom, the constants GRND_NONBLOCK and GRND_RANDOM should also be defined.
In preparation for eventually having a non-Emscripten based wasm32 target, this
commit makes `libc` the crate an empty library on wasm32 targets that are not
with `target_os = "emscripten"`. This may eventually get filled out over time,
but for now it's all empty!
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.
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 Darwin.
Darwin uses SOL_LOCAL/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)
Add support for aarch64-unknown-linux-musl
This adds support for aarch64-unknown-linux-musl as requested in rust-lang/rust#44779 by @alexcrichton
The new file `ci/docker/aarch64-unknown-linux-musl/Dockerfile` essentially merges the aarch64-unknown-linux-gnu and x86_64-unknown-linux-musl Dockerfiles.
The bigger changes are under `src/unix/notbsd/linux/`, though they're fairly superficial:
Previously, some constants could be shared between all 64-bit musl triples, but aarch64 differs, so a number of things were moved from `musl/b64/mod.rs` to specific arches: `musl/b64/powerpc64.rs` and `musl/b64/x86_64.rs`, with the aarch64-specific differences being added to `musl/b64/aarch64.rs`.
Similarly, some constants moved from `musl/mod.rs` to lower levels: `musl/b32/mod.rs`, `musl/b64/powerpc64.rs`, and `musl/b64/x86_64.rs`, with the aarch64-specific differences added to `musl/b64/aarch64.rs`.
Finally, some things that were true of all Linux builds moved from `mod.rs` into lower levels: `mips/mod.rs`, `other/mod.rs`, `musl/b32/mod.rs`, `musl/b64/powerpc64.rs`, and `musl/b64/x86_64.rs`, with the aarch64-specific differences added to `musl/b64/aarch64.rs`.
Testing:
All linux-based triples under `ci/docker` were run through `ci/run-docker.sh` successfully, which checks that the size and alignment of definitions match for each triple, among other tests. (The local build of rust from rust-lang/rust#44779 was set for the aarch64-unknown-linux-musl build.)
I also confirmed that it has "good style!" according to `ci/style.rs`.