* 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`.
* 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.
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 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!
Rustix's statx code now depends on linux-raw-sys, in order to obtain
Linux's `STATX__RESERVED` value, which musl doesn't export. As such,
always enable the linux-raw-sys dependency on Linux targets.
Fixes#389.
Add several more users, add update the sed lines to handle the
`^version` match in the windows-sys dependency. All this sed+grep
code is pretty hairy, but it works for now.
* Fix compilation on arm-linux-androideabi.
arm-linux-androideabi's `st_dev` is 64-bit, even though its `dev_t` is
32-bit.
* Move qemu arguments into qemu_args for mipsel and mips64el.
The cache script needs the name of the qemu binary without the args, so
always split the args into a separate variable.
* `linux_execfn` is unavailable on 32-bit Android.
* Fix types for non-x86 32-bit Android.
* Add aarch64-apple-ios as a cross target to CI.
* Remove `ZStr` and `ZString`.
Use `CStr` and `CString` instead, now that nightly has then in core and
alloc, respectively.
Fixes#336.
* Enable "core_c_str" on nightly to use core::ffi::CStr.
* Don't test --no-default-features on stable.
--no-default-features disables "std", and building without "std" will
require nightly now.
* `CString` and `NulError` are in alloc.
* Add comments to the relevant Cargo.toml features.
* rustfmt
* Implement a new `rustix::termios` module.
Implement a new termios module, containing tcdrain, tcflow, tcflush,
tcgetpgrp, tcgetsid, tcsendbreak, tcsetattr, tcsetpgrp, tcsetwinsize,
and all the cf* functions.
This also renames APIs like `ioctl_tcgets` to more POSIX-like names,
like `tcgetattr`.
* Put the termios API under a "termios" cargo feature.
In anticipation of #250, put the "termios" API under a "termios" feature.
* Move `isatty` into the termios API module.
* Make `RawMode` on x86 Android be `c_uint`.
Android's `mode_t` is `u16`, which is different than its `stat`'s
`st_mode`.
* Move `ttyname` into the `termios` module.
windows-latest now refers to windows-2022, and macos-latest now refers
to macos-11. Update main.yml so that it doesn't test windows-2022
and macos-11 redundantly, and so that it does test macos-10.15 and
windows-2019.
In test-users.yml, use macos-latest instead of macos-11.
* Use `c_uint` rather than `bool` in `getsockopt` calls.
`getsockopt` and `setsockopt` represent boolean values as integers, not as
`bool` types. The code already handled this for `setsockopt`, but not
for `getsockopt`. Handle it for `getsockopt`, and add assertions to catch
accidental uses of `bool.
* Remove an incorrect workaround for the bug now being fixed.
* Make the internal `getsockopt`/`setsockopt` require `T: Copy`.
As in the standard library, require rustix's internal
`getsockopt`/`setsockopt`'s generic parameter to implement `Copy`, to
discourage use with bogus types.
* Use `RUST_BACKTRACE=full` to capture full CI test failure backtraces.
* Handle Windows' `getsockopt` writing fewer bytes than expected.
* Use `BOOL` for sockopt booleans on Windows.
And, wrap sockopt boolean values in a newtype to discourage misuse.
Inline asm is now stabilized in Rust 1.59, so we can now use it
without `#[feature(asm)], on stable and nightly. Update the detection
to detect the presence of `std::arch::asm`.
Qemu doesn't yet support `SO_RCVTIMEO_NEW`/`SO_SENDTIMEO_NEW`, and it
unfortunately returns a bogus int instead of properly failing. For now,
patch qemu to fail in this case. The qemu bug is now reported
upstream [here].
[here]: https://gitlab.com/qemu-project/qemu/-/issues/885
And, when converting from nanoseconds to microseconds for the `*_OLD`
calls, round up rather than rounding down, so that the resulting timeout
is at least as long as requested.
Make the time conversion in `set_socket_linger` round up.
And, add tests for `set_socket_linger` and several other sockopt calls.
Closes: https://github.com/bytecodealliance/rustix/issues/215
Introduce a `use-libc` cargo feature, which allows downstream crates to enable the libc backend via cargo features.
This has the downside of introducing a linux-raw-sys dependency in linux builds that use the libc backend, however the linux-raw-sys dependency is not used.
* Fix several issues in the test-users script.
- In the Rust build, use a downloaded LLVM to avoid needing the dependencies
needed to build LLVM.
- Fix the name of the ostree-rs-ext repository.
- Install libostree-dev for the ostree-rs-ext build.
- Launch a dbus-daemon for the dbus-rs tests to use.
* More fixes.
- Set the fetch depth for Rust so that it can download LLVM.
- Install at-spi2-core for dbus.
* Fix copypasta in a test.
* When building std, use the rustc-dep-of-std branch.
* Fetch the rustc-dep-of-std branch before rebasing over it.
* Run test-users.yml across multiple architectures.
* More testing.
Remove ostree-rs-ext because it depends on a newer version of libostree-dev
than available in the available virtual environments.
"Requested 'ostree-1 >= 2021.5' but version of OSTree is 2020.3"
* powerpc64le
* Add listenfd.
* Enable caching of the qemu build.
* Fix the assignments of the RUNNER variables.
* Set the rustix version to match the dependency version.
* Fix the thttp script.
This mostly follows other architectures, however Rust's inline asm is currently
considered experimental on PowerPC, so this uses outline asm by default even on
Rust nightly.
Fixes#188.
* Add a CI script to test rustix's reverse dependencies.
As suggested [here], add a CI script to test some of rustix's reverse
dependencies. For now, this runs on `workflow_dispatch` rather than all
PRs, as it takes a lot of time, and there are still some parts of the
test script that need fixing.
[here]: https://github.com/bytecodealliance/rustix/pull/197#issuecomment-1026926506
* Use actions/checkout, and fix the ostree-ext repo URL.
* Remove the sed lines for -alpha.0 versions.
The existing CI code checked it for --release builds; this ensures it's
checked for debug builds as well.
This also updates the debug builds which became out of date after
f7e4c56d added comments to the .s files, changing the line numbers in
the .debug_line sections.
Enabling the "cc" feature causes the build.rs script to check that the
precompiled libraries match the libraries generated from source.
This also updates the libraries, in which the only change is the debug
info string mentioning the compilation directory chaging from "rsix"
to "rustix".
Add an MSRV of 1.48, and adjust the code to avoid depending on newer
versions.
Test 1.48, and test more macos and windows versions, and don't test
beta anymore.