Age | Commit message (Collapse) | Author |
|
|
|
1619: Added getters for the MqAttr struct r=rtzoeller a=fpagliughi
With the existing code, if you call `mq_getattr()`, there does not appear to be a way to get any of the attributes from the returned `MqAttr` struct, other than the flags. This adds getter functions to retrieve the size parameters of the queue, and the current number of messages in the queue.
Co-authored-by: fpagliughi <fpagliughi@mindspring.com>
|
|
|
|
1596: Add NetBSD configuration for supported process resources r=asomers a=schctl
In addition to existing resources, NetBSD supports `RLIMIT_MEMLOCK`, `RLIMIT_NPROC` and `RLIMIT_RSS`.
https://man.netbsd.org/setrlimit.2
`RLIMIT_AS` is also supported, but it looks like it was added [after version 5.0](https://mail-index.netbsd.org/tech-kern/2009/03/28/msg004702.html), so I'm not sure if that should be enabled.
1621: Add posix_fallocate on DragonFly r=asomers a=rtzoeller
Enable the existing `posix_fallocate()` tests as they are passing locally.
Co-authored-by: Sachin Cherian <sachinctl@protonmail.com>
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
1620: Fix typos in documentation r=asomers a=rtzoeller
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
|
|
|
|
1547: feat: Add glibc::SOF_TIMESTAMPING_* support r=asomers a=pacak
Support for kernel and hardware receive timestamps
Co-authored-by: Michael Baikov <manpacket@gmail.com>
|
|
1616: Disable mknod and mknodat tests on DragonFly r=asomers a=rtzoeller
Like FreeBSD, DragonFly does not support creating regular files (i.e. `S_IFREG`) with `mknod` or `mknodat`. These tests should be disabled as they always fail.
There are still a few other failing tests on DragonFly, but it is unclear to me if they are due to faulty/inapplicable test logic or a bug in DragonFly.
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
|
|
1614: Improve the sockaddr interface: r=asomers a=asomers
* All sockaddr newtypes should be repr(transparent)
* All sockaddr newtypes should be opaque, so the user can't do something
like change the sa_family field in a way that violates invariants.
This is a prerequisite for #1544.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
1582: impl Send and Sync for IoVec r=rtzoeller a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
1613: Fix clippy warning by adding #[must_use] r=asomers a=rtzoeller
Clippy added a lint for non-constructor methods which return `self`, encouraging them to be marked as `#[must_use]`.
Mark the methods which are failing with the latest nightly's clippy.
```
$ cargo clippy
warning: missing `#[must_use]` attribute on a method returning `Self`
--> src/sys/aio.rs:1068:5
|
1068 | / pub fn emplace_slice(mut self, fd: RawFd, offs: off_t, buf: &'a [u8],
1069 | | prio: libc::c_int, sigev_notify: SigevNotify,
1070 | | opcode: LioOpcode) -> Self
1071 | | {
... |
1074 | | self
1075 | | }
| |_____^
|
= note: `#[warn(clippy::return_self_not_must_use)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
warning: missing `#[must_use]` attribute on a method returning `Self`
--> src/sys/aio.rs:1084:5
|
1084 | / pub fn emplace_mut_slice(mut self, fd: RawFd, offs: off_t,
1085 | | buf: &'a mut [u8], prio: libc::c_int,
1086 | | sigev_notify: SigevNotify, opcode: LioOpcode)
1087 | | -> Self
... |
1091 | | self
1092 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
warning: `nix` (lib) generated 2 warnings
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
```
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
1537: DragonFly BSD supports `sched_getaffinity()` and `sched_setaffinity()` r=rtzoeller a=rtzoeller
Move `CpuSet`, `sched_getaffinity()`, and `sched_setaffinity()` from the `sched_linux_like` namespace to `sched_affinity`. Declare support for DragonFly BSD.
`test_sched_affinity()` passes locally on DragonFly BSD.
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
|
|
|
|
1581: Add fdatasync for missing platforms r=rtzoeller a=rtzoeller
These platforms stub out `fdatasync()` by just calling `fsync()`, but that is a conforming implementation.
DragonFly recently provided [an implementation](https://github.com/DragonFlyBSD/DragonFlyBSD/commit/74fa2560ac77f9db4a34b2a7c72450126fec4ed6), but it has not made it into a release or rust-lang/libc.
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
|
|
1567: Recent versions of Android support EPOLLEXCLUSIVE r=rtzoeller a=rtzoeller
[Corresponding libc change](https://github.com/rust-lang/libc/commit/36be4cd4f65c326f2a30d3afee50db78c014f07f).
Enable the epoll tests on Android, because they are passing.
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
Enable epoll tests on Android, because they are passing.
|
|
1577: DragonFly 6.0 added fexecve(2) r=rtzoeller a=rtzoeller
Enable `fexecve()` on DragonFly, as it was added in the 6.0 release.
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
1571: Remove broken newlib support r=rtzoeller a=asomers
Nix has never supported a newlib target, but there were a few cfg checks
for it in our codebase. Some of them were misspelled (newlibc vs
newlib), and some of the checks were wrong. Removing them makes the
code much more readable.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
1583: Remove unsafe in with_nix_path() for [u8] r=asomers a=rtzoeller
Remove use of `unsafe` in the implementation of `with_nix_path()` for `[u8]`. This also comes with a nice determinism win across input sizes, and is fairly performance neutral (slightly slower for small strings, much faster for large strings).
I suspect the performance degradation in the existing implementation is related to the following note in the `CStr::from_ptr()` documentation:
> Note: This operation is intended to be a 0-cost cast but it is currently implemented with an up-front calculation of the length of the string. This is not guaranteed to always be the case.
---
Tested with `cargo 1.57.0-nightly (7fbbf4e8f 2021-10-19)`, with variations of the following benchmarking code:
```rs
#[bench]
fn bench_with_nix_path_1024(b: &mut test::Bencher) {
let bytes = std::hint::black_box([70u8; 1024]);
b.iter(|| {
bytes.with_nix_path(|cstr| {
std::hint::black_box(&cstr);
}).unwrap();
})
}
```
| Length | Before Change | After Change |
|--------|-----------------------|-----------------------|
| 16 | 37 ns/iter (+/- 0) | 44 ns/iter (+/- 0) |
| 64 | 39 ns/iter (+/- 0) | 44 ns/iter (+/- 0) |
| 256 | 84 ns/iter (+/- 0) | 48 ns/iter (+/- 0) |
| 1024 | 232 ns/iter (+/- 1) | 50 ns/iter (+/- 1) |
| 4095 | 796 ns/iter (+/- 8) | 62 ns/iter (+/- 2) |
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
* All sockaddr newtypes should be repr(transparent)
* All sockaddr newtypes should be opaque, so the user can't do something
like change the sa_family field in a way that violates invariants.
This is a prerequisite for #1544.
|
|
1611: feature-gate most Nix functions r=rtzoeller a=asomers
Using features reduces build time and size for consumer crates. By
default all features are enabled.
Co-authored-by: Vincent Dagonneau <vincentdagonneau@gmail.com>
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
|
|
|
|
Using features reduces build time and size for consumer crates. By
default all features are enabled.
|
|
1609: Fix warning when running cargo release r=rtzoeller a=rtzoeller
`cargo release` is returning the following warning: `WARN cargo_release::config] Negative config values are deprecated ('no_', 'disable_')`.
The root cause is `cargo-release` changing its behavior to default to not bumping the version: https://github.com/crate-ci/cargo-release/pull/340. Remove the `no-dev-version flag` from release.toml to match.
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
|
|
|
|
|
|
1608: [skip ci] Update cargo-release syntax in the docs r=rtzoeller a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
1607: Relax the bitflags dependency from 1.3.1 to 1.1 r=rtzoeller a=asomers
Fixes #1555
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
Fixes #1555
|
|
|
|
1561: Declare the MSRV in Cargo.toml r=rtzoeller a=asomers
This is a new feature in Cargo 1.56.0, currently in beta. Once Nix's
MSRV is >= 1.56.0, this feature will prevent future problems like the
bitflags 1.3.0 fiasco.
Issue #1491
Issue #1510
Issue #1548
Issue #1555
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
1606: Test preadv and pwritev on more operating systems r=rtzoeller a=asomers
This was an oversight from PR #1511. Also, update the OSX test environment for Big Sur. Big Sur is the first OSX version that supports preadv/pwritev
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
Newer rustc is broken on DragonflyBSD, probably by https://github.com/rust-lang/rust/commit/e68887e67cc6b7bb4ea5113a40eaa4c0831bda13
|
|
Big Sur is the first OSX version that supports preadv/pwritev
|
|
This was an oversight from PR #1511
|
|
1593: Ensure that MSRV tests do not regress r=asomers a=matklad
When testing with older versions of rustc, there's a CI failure mode
when our dependency, which used to be compatible with that Rust version,
publishes a new version which can't be compiled using that old Rust
anymore. That's pretty unfortunate, as that means that third parties can
break our CI without any changes to the code in this repo.
To protect against that, let's use Cargo.lock on CI, but only when
testing against older versions. For stable Rust, we continue to generate
Cargo.lock with freshest dependencies. Implementation wise, we save
known-good Cargo.lock as `Cargo.lock.msrv`, and just copy that in every
relevant CI job.
To get a working `Cargo.lock.msrv`, I run `cargo +nightly
generate-lockfile -Zminimal-versions` -- that is guaranteed to support
the oldest Rust version we can.
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
|
|
1605: clippy cleanup with the latest nightly r=rtzoeller a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
1601: Update `mman` related docs r=rtzoeller a=schctl
Added docs for `memfd_create`, `shm_open`, and `shm_unlink`, and some man-page and intra doc links.
Co-authored-by: Sachin Cherian <sachinctl@protonmail.com>
|
|
- Add docs for `memfd_create`, `shm_open`, and `shm_unlink`
- Add man-page links
- Remove` #[allow(missing_docs)]`on the `memfd` module
|