@@ -7,15 +7,17 @@ greater than the requested size.
77
88[ `rustix::pipe::fcntl_setpipe_size` ] : https://docs.rs/rustix/1.0.0/rustix/pipe/fn.fcntl_setpipe_size.html
99
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] .
10+ When a ` &mut Vec<_> ` is passed to [ ` rustix::event::epoll::wait ` ] ,
11+ [ ` rustix::event::kqueue::kevent ` ] , or [ ` rustix::event::port::getn ` ] , these
12+ functions previously adjusted the length of the ` Vec ` to the number of elements
13+ written, and now do not. A common alternative is to wrap the ` &mut Vec<_> `
14+ using [ ` spare_capacity ` ] , and then to clear the ` Vec ` by iterating using
15+ ` .drain(..) ` after each call. For an example of using ` spare_capacity ` in this
16+ way, see [ here] .
1617
1718[ `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+ [ `rustix::event::kqueue::kevent` ] : https://docs.rs/rustix/1.0.0/x86_64-unknown-freebsd/rustix/event/kqueue/fn.kevent.html
20+ [ `rustix::event::port::getn` ] : https://docs.rs/rustix/1.0.0/x86_64-unknown-illumos/rustix/event/port/fn.getn.html
1921[ `spare_capacity` ] : https://docs.rs/rustix/1.0.0/rustix/buffer/fn.spare_capacity.html
2022[ here ] : https://docs.rs/rustix/1.0.0/rustix/event/epoll/index.html#examples
2123
@@ -287,18 +289,19 @@ a `[MaybeUninit<u8>]` instead of a `[u8]`.
287289[ `RecvAncillaryBuffer` ] : https://docs.rs/rustix/1.0.0/rustix/net/struct.RecvAncillaryBuffer.html
288290
289291[ ` read ` ] , [ ` pread ` ] , [ ` recv ` ] , [ ` recvfrom ` ] , [ ` getrandom ` ] , [ ` epoll::wait ` ] ,
290- [ ` kqueue ` ] , [ ` getxattr ` ] , [ ` lgetxattr ` ] , [ ` fgetxattr ` ] , [ ` listxattr ` ] ,
291- [ ` llistxattr ` ] , and [ ` flistxattr ` ] now use the new [ ` Buffer ` trait] .
292+ [ ` kevent ` ] , [ ` port::getn ` ] , [ ` getxattr ` ] , [ ` lgetxattr ` ] , [ ` fgetxattr ` ] ,
293+ [ ` listxattr ` ] , [ ` llistxattr ` ] , and [ ` flistxattr ` ] now use the new
294+ [ ` Buffer ` trait] .
292295
293296This replaces ` read_uninit ` , ` pread_uninit ` , ` recv_uninit ` , ` recvfrom_uninit ` ,
294297and ` getrandom_uninit ` , as the ` Buffer ` trait supports reading into
295298uninitialized slices.
296299
297- ` epoll::wait ` and ` kqueue ` previously took a ` Vec ` which it implicitly cleared
298- before results were appended. When passing a ` Vec ` to ` epoll::wait ` or ` kqueue `
299- using [ ` spare_capacity ` ] , the ` Vec ` is not cleared first. Consider clearing the
300- vector before calling ` epoll::wait ` or ` kqueue ` , or consuming it using
301- ` .drain(..) ` before reusing it.
300+ ` epoll::wait ` , ` kevent ` , and ` port::getn ` previously took a ` Vec ` which they
301+ implicitly cleared before results were appended. When passing a ` Vec ` to
302+ ` epoll::wait ` , ` kevent ` , or ` port::getn ` using [ ` spare_capacity ` ] , the ` Vec ` is
303+ not cleared first. Consider clearing the vector before calling ` epoll::wait ` ,
304+ ` kevent ` , or ` port::getn ` , or consuming it using ` .drain(..) ` before reusing it.
302305
303306[ `read` ] : https://docs.rs/rustix/1.0.0/rustix/io/fn.read.html
304307[ `pread` ] : https://docs.rs/rustix/1.0.0/rustix/io/fn.pread.html
@@ -312,7 +315,8 @@ vector before calling `epoll::wait` or `kqueue`, or consuming it using
312315[ `listxattr` ] : https://docs.rs/rustix/1.0.0/rustix/fs/fn.listxattr.html
313316[ `llistxattr` ] : https://docs.rs/rustix/1.0.0/rustix/fs/fn.llistxattr.html
314317[ `flistxattr` ] : https://docs.rs/rustix/1.0.0/rustix/fs/fn.flistxattr.html
315- [ `kqueue` ] : https://docs.rs/rustix/1.0.0/x86_64-unknown-freebsd/rustix/event/kqueue/fn.kqueue.html
318+ [ `kevent` ] : https://docs.rs/rustix/1.0.0/x86_64-unknown-freebsd/rustix/event/kqueue/fn.kevent.html
319+ [ `port::getn` ] : https://docs.rs/rustix/1.0.0/x86_64-unknown-illumos/rustix/event/port/fn.getn.html
316320[ `Buffer` trait ] : https://docs.rs/rustix/1.0.0/rustix/buffer/trait.Buffer.html
317321[ `spare_capacity` ] : https://docs.rs/rustix/1.0.0/rustix/buffer/fn.spare_capacity.html
318322
@@ -335,5 +339,10 @@ In place of `BadOpcode`, use the opcode value directly.
335339[`rustix :: ioctl :: Opcode `]: https : // docs.rs/rustix/1.0.0/rustix/ioctl/type.Opcode.html
336340[`ioctl :: opcode `]: https : // docs.rs/rustix/1.0.0/rustix/ioctl/opcode/index.html
337341
342+ [`rustix :: event :: port :: getn `]'s `min_events ` argument is now a `u32 `, to
343+ reflect the type in the underlying system API .
344+
345+ [`rustix :: event :: port :: getn `]: https : // docs.rs/rustix/1.0.0/x86_64-unknown-illumos/rustix/event/port/fn.getn.html
346+
338347All explicitly deprecated functions and types have been removed . Their
339348deprecation messages will have identified alternatives .
0 commit comments