diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-31 00:13:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 00:13:58 +0000 |
commit | 892daf1bc7bb4ea91c1c9c5f69ba3ee386c99a8b (patch) | |
tree | 79ff8b8b8854c40d77eb83165b73de7ed56a5487 /CHANGELOG.md | |
parent | 9f1b35b5d4a176ed7c09b576b461620c632c0182 (diff) | |
parent | 5ac876e17df37315585f178ec3b762786e05a092 (diff) | |
download | nix-892daf1bc7bb4ea91c1c9c5f69ba3ee386c99a8b.zip |
Merge #1440
1440: Adapt aio to the world of async/await, and fix some potential unsound… r=asomers a=asomers
…ness.
* libc::aiocb must not be moved while the kernel has a pointer to it.
This change enforces that requirement by using std::pin.
* Split LioCbBuilder out of LioCb. struct LioCb relied on the
(incorrect) assumption that a Vec's elements have a stable location in
memory. That's not true; they can be moved during Vec::push. The
solution is to use a Vec in the new Builder struct, but finalize it to
a boxed slice (which doesn't support push) before allowing it to be
submitted to the kernel.
* Eliminate owned buffer types. mio-aio no longer uses owned buffers
with nix::aio. There's little need for it in the world of
async/await. I'm not aware of any other consumers. This
substantially simplifies the code.
Co-authored-by: Alan Somers <asomers@gmail.com>
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r-- | CHANGELOG.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e163be9..0fc57f62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,18 @@ This project adheres to [Semantic Versioning](https://semver.org/). (#[1429](https://github.com/nix-rust/nix/pull/1429)) - Made `Uid::is_root` a `const fn` (#[1429](https://github.com/nix-rust/nix/pull/1429)) +- `AioCb` is now always pinned. Once a `libc::aiocb` gets sent to the kernel, + its address in memory must not change. Nix now enforces that by using + `std::pin`. Most users won't need to change anything, except when using + `aio_suspend`. See that method's documentation for the new usage. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- `LioCb` is now constructed using a distinct `LioCbBuilder` struct. This + avoids a soundness issue with the old `LioCb`. Usage is similar but + construction now uses the builder pattern. See the documentation for + details. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- Minimum supported Rust version is now 1.41.0. + ([#1440](https://github.com/nix-rust/nix/pull/1440)) ### Fixed - Allow `sockaddr_ll` size, as reported by the Linux kernel, to be smaller then it's definition @@ -28,6 +40,11 @@ This project adheres to [Semantic Versioning](https://semver.org/). - Removed `sys::socket::accept4` from Android arm because libc removed it in version 0.2.87. ([#1399](https://github.com/nix-rust/nix/pull/1399)) +- `AioCb::from_boxed_slice` and `AioCb::from_boxed_mut_slice` have been + removed. They were useful with earlier versions of Rust, but should no + longer be needed now that async/await are available. `AioCb`s now work + exclusively with borrowed buffers, not owned ones. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) ## [0.20.0] - 20 February 2021 ### Added |