* 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 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.
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.
Do not resize internal buffer on error, otherwise iterator gets stuck in
infinite loop with zeroed `dirent`s after the first error. Correct
behavior is to return error indefinitely if it persists.
Error can be ENOENT if the directory is unlinked while iterating, for
example.
Signed-off-by: Aleksandr Trukhin <alxtry@gmail.com>
`#[cfg(target_feature = "thumb-mode")]` isn't available on stable, so
use a build.rs script to detect whether we can use `r7` in inline asm
on ARM targets.
* Fix linux-raw inline asm for thumb-mode.
In thumb-mode, r7 is reserved as the frame pointer and isn't permitted
as an inline asm operand. It's still the syscall-number operand in
syscalls though, so pass the syscall-number operand in in a separate
register, copy it into r7 inside the inline asm, and then restore the
value of r7 when we're done.
* Add a thumbv7neon-unknown-linux-gnueabihf line to CI.
* Fix compilation on sparc targets.
Adjust cfg's as needed to fix compilation errors on sparc.
Fixes#408.
* Rust's 32-bit sparc Linux target has a 32-bit time_t.
Add a tier-3 CI check for x86_64-unknown-dragonfly, and fix the
compilation errors needed to compile with --features=all-apis.
This builds on top of #409!