Define `TCSANOW`, `TCSADRAIN`, and `TCSAFLUSH` for MIPS, since MIPS
defines these differently from all other architectures, and in a way
that bindgen doesn't support.
Originally, the idea of having multiple versions was to attempt to
support writing code that was strictly compatible with old versions.
However, my experience with linux-raw-sys so far as been that that's
not as useful as it seemed like it would be, and versioning all the
imports means having multiple versions of all the types, which gets
awkward.
So instead, switch to having just a single Linux version, 5.11 for
now, which is mostly a superset of the other versions.
This also helps reduce compile times, as there aren't multiple
versions of everything to parse.
We've been collecting manual definitions of ioctl codes for a while, and
it looks like we're going to be collecting more over time, so start trying
a different strategy: use a script and a C program to extract ioctl values
from the headers semi-automatically.
The script itself isn't very easy to run, and I'm open to ideas for how
to do it better. However, this should cover most of Linux's existing ioctls,
so hopefully we won't need to run it very often.
Code in general.h should contain just what's needed for interoperability
with the Linux kernel ABI. Add a comment explaining this, and tidy up
a few parts of the code to follow this advice.
In `no_std` builds, define `ctypes` types manually instead of depending
on the `cty` crate. These types are straightforward to define for all
Linux targets.
* Add BLKPBSZGET for x86_64
* Add BLKPBSZGET for everyone but sparc
* Add BLKSSZGET for everyone but sparc
* Update reference bindings
* Fix BLKSSZGET and BLKPBSZGET included in sparc bindings
* Add BLKSSZGET and BLKPBSZGET to sparc
* Do a partial clone of linux
This saves a lot of disk space. The git dir for the partial clone after
all relevant versions have been checked out is 1.7GB.
* Do a sparse checkout of linux
This saves a lot of disk space. The git dir for the partial clone after all relevant versions have been checked out is <800MB.
* Fix typo
* Fix checkout on CI
* Add CI
* Make generation deterministic
Directory iteration order is non-deterministic. In practice it depends
on the exact order in which dir entries have been created. Sort the
output of fs::read_dir to ensure that generation is deterministic across
systems.
* Check for linux/.git
* Build generator in release mode
* Switch to cargo check