|
1 | | -# Changes from 0.38.x to 1.0 |
| 1 | +# Changes from 0.38.x to 1.x |
2 | 2 |
|
3 | | -## Behavior changes |
| 3 | +## Silent behavior changes |
4 | 4 |
|
5 | 5 | [`rustix::pipe::fcntl_setpipe_size`] now returns the new size, which may be |
6 | 6 | greater than the requested size. |
7 | 7 |
|
8 | 8 | [`rustix::pipe::fcntl_setpipe_size`]: https://docs.rs/rustix/1.0.0/rustix/pipe/fn.fcntl_setpipe_size.html |
9 | 9 |
|
| 10 | +When a `&mut Vec<_>` is passed to [`rustix::event::epoll::wait`] or |
| 11 | +[`rustix::event::kqueue::kevent`], these functions previously adjusted the |
| 12 | +length of the `Vec` to the number of elements written, and now do not. A common |
| 13 | +alternative is to wrap the `&mut Vec<_>` using [`spare_capacity`], and then to |
| 14 | +clear the `Vec` by iterating using `.drain(..)` after each call. For an example |
| 15 | +of using `spare_capacity` in this way, see [here]. |
| 16 | + |
| 17 | +[`rustix::event::epoll::wait`]: https://docs.rs/rustix/1.0.0/rustix/event/epoll/fn.wait.html |
| 18 | +[`rustix::event::kqueue::kevent`]: https://docs.rs/rustix/1.0.0/x86_64-unknown-freebsd/rustix/event/kqueue/fn.kqueue.html |
| 19 | +[`spare_capacity`]: https://docs.rs/rustix/1.0.0/rustix/buffer/fn.spare_capacity.html |
| 20 | +[here]: https://docs.rs/rustix/1.0.0/rustix/event/epoll/index.html#examples |
| 21 | + |
10 | 22 | ## API changes |
11 | 23 |
|
12 | 24 | `rustix::thread::FutexOperation` and `rustix::thread::futex` are removed. Use |
@@ -53,11 +65,12 @@ the capitalization), for consistency with [`rustix::process::WaitId`]. |
53 | 65 | [`rustix::process::WaitId`]: https://docs.rs/rustix/1.0.0/rustix/process/enum.WaitId.html |
54 | 66 |
|
55 | 67 | The offsets in [`rustix::fs::SeekFrom::Hole`] and |
56 | | -[`rustix::fs::SeekFrom::Data`] are changed from `i64` to `u64` since they |
57 | | -represent absolute offsets. |
| 68 | +[`rustix::fs::SeekFrom::Data`] are changed from `i64` to `u64`, to |
| 69 | +[align with std], since they represent absolute offsets. |
58 | 70 |
|
59 | 71 | [`rustix::fs::SeekFrom::Hole`]: https://docs.rs/rustix/1.0.0/rustix/fs/enum.SeekFrom.html#variant.Hole |
60 | 72 | [`rustix::fs::SeekFrom::Data`]: https://docs.rs/rustix/1.0.0/rustix/fs/enum.SeekFrom.html#variant.Data |
| 73 | +[align with std]: https://doc.rust-lang.org/stable/std/io/enum.SeekFrom.html#variant.Start |
61 | 74 |
|
62 | 75 | Functions in [`rustix::net::sockopt`] are renamed to remove the `get_` prefix, |
63 | 76 | to [align with Rust conventions]. |
|
0 commit comments