Move more ioctl constants and flags to linux::arch::* modules.
This PR moves a few things to `linux::arch::*` modules and out of libc specific modules. Specifically, it:
* Moves the `TIOCM*` ioclt constants and associated flags.
* Moves the `BOTHER` flag.
* Adds the `IBSHIFT` flag.
Without this PR, there are some arch+libc combinations that are missing some of these constants. Since these are all ioctl numbers or arguments to ioctls, they are not specific to any libc flavour. `BOTHER` and `IBSHIFT` don't even appear in glibc or musl headers.
Scope in Send, Sync for wasi
Without this, libc fails during the build of rustc. See https://github.com/rust-lang/rust/pull/90681
This dependency was introduced in rust-lang/libc#2499.
Alternative solution: It's not clear this is necessary for core to finish building,
so maybe we should `#[cfg]` it out in that case, instead?
Add TIOCM_* constants for Illumos and Solaris.
Values taken from 252adeb303/usr/src/uts/common/sys/termios.h (L466-L476)
Since Illumos forked from OpenSolaris 10, I'm assuming that Solaris is still using the same values for binary compatibility. But since Solaris is no longer open source, I couldn't find a way to verify it myself.
Bump libc to 0.2.107
Primarily so as to fix building for aarch64-unknown-linux-musl,
as implemented in commit fd331f65f2
This may help resolve https://github.com/rust-lang/rust/pull/90044
I do not have release privileges for libc, so if anyone would be so kind as to tag it and publish to crates.io, that would be lovely.
Move termios2 struct and ioctl constants to linux::arch::*.
When trying to use the newly added ioctls from #2508 I noticed that the `termios2` struct was not defined for musl or uclibc, except interestingly for the hexagon+musl target
However, the `termios2` struct and ioctls are part of the Linux headers, not part of the libc headers. So the libc flavour doesn't matter for these definitions.
This PR moves the definitions to the `linux::arch::*` modules, to make them available for all libc flavours and reduce code duplication as a bonus.
Add TCGETS2 and TCSETS2 (and variants) ioctl constants for Linux.
I noticed that the `termios2` struct is already exposed, but the ioctl constants to use it are not. This PR adds the `TCGETS2`, `TCSETS2`, `TCSETSW2` and `TCSETSF2` on Linux so that you can actually do something with the `termios2` struct.
The `powerpc` architecture is notably missing, because it does not seem to support the `TCGETS2`/`TCSETS2` ioctls.
I *think* the constants are correct for all platforms, but I'm also not 100% sure. Do the unit tests verify the values for all supported platforms, by any chance?
Add memfd_create to linux and android
Android only added the wrapper in API level 30, i.e. Android 11. Should this have libc::syscall implementation for android ?
Document stat.st_blksize changes on DragonFly BSD
The tests are currently failing on DragonFly BSD, due to [changes to `stat.st_blksize`](34c6728ee2) among other reasons.
`st_blksize` is now an `i64`, and has moved to take up a previously reserved struct member. Deprecate the struct, to indicate it will be modified in a subsequent release.