* Fix compilation on armv7-unknown-freebsd
Use `time_t::MAX` to avoid depending on the relationship between
`time_t` and `c_long`.
* Silence the deprecation warning about `time_t`.
FreeBSD 12 has been failing in CI like this:
```
...
[5/5] Extracting curl-7.87.0: .......... done
curl https://sh.rustup.rs -sSf --output rustup.sh
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Exit status: 60
```
The FreeBSD 13 run still works, so switch to just testing on
FreeBSD 13.
FreeBSD 12 changes the dirent structure, among other things. libc
currently binds a FreeBSD 11 ABI, but that will change some day. Tweak
rustix's dirent initialization code to work with either FreeBSD 11 or
12.
* Fix the tests to run on 1.48.
This puts the benchmarks behind a `criterion` cfg, so add
`--cfg=criterion` to RUSTFLAGS when running cargo bench.
An MSRV of 1.48 enables us to support users such as async-io, which also
has an MSRV of 1.48.
* Add a rust-version field.
This prints a warning under Rust 1.48, but only when rustix is the
top-level build; when rustix is a dependency, it doesn't warn, so this
seems ok.
We don't actually do anything different for different errno values,
other than panic on unknown ones, and that isn't that isn't adding
much value compared to the cost of being an extra surprise when
porting to new OS's.
Fixes#467.
In some configurations, the param module needs to open /proc/self/auxv,
and it needs the fs API to do that, so make the param module depend on
the fs module.
Also, disable the init_from_proc_self_auxv code on mustang, which
doesn't need it.
Move `fcntl_getfd`, `fcntl_setfd`, and `fcntl_dupfd_cloexec` out of
the `fs` module and into the `io` module, since they're not specific
to files, directories or memfd. This allows them to be used with the
"fs" feature is not enabled.
Also, add public aliases for then in `fs`, for compatibility, and to
have a place where all `fcntl` function are present.
And add a CI check for --no-default-features with no API features.
Fixes#453.
Fix a few minor clippy lints, and add clippy overrides for warnings that
we can't easily fix due to our MSRV, or due to our support of multiple targets.
Rustix no longer has anything in the tree that needs the `fs` module
when the public "fs" feature isn't enabled, so make the `fd` module
conditional on `cfg(feature = "fs")`.
As a followup to #444, remove the uid/gid checks from the procfs code
entirely. Procfs files can have their owner changed to root:root under
`PR_SET_DUMPABLE`, and root can be remapped to nobody by user
namespaces.
This check wasn't guarding against a known problem, and it's complex
to make sure it doesn't spuriously fail under any vald configuration,
so just remove it.
When a process is marked as non-dumpable, Linux changes the permissions
of the files under /proc/<pid> as owned by root:root. Relax the procfs
code, including removing use of `O_NOATIME`, so that it works on files
owned by `root:root`.
Fixes#441.
* Enable the "close" feature for io-lifetimes.
This follows up on #422, but enables "close" on the regular dependency
too, and not just the dev-dependency.
* Temporarily disable the backends no-libc test.
Update `src/net/ip.rs` and `src/net/addr.rs` to use the new std code,
making these structures platform independent.
Doesn't include the new Debug/Display formatting code for these
structures, although that could have been added now that it doesn't
depend on std anymore.