@@ -85,7 +85,7 @@ use core::ptr::null_mut;
8585use core:: slice;
8686
8787bitflags ! {
88- /// `EPOLL_*` for use with [`new `].
88+ /// `EPOLL_*` for use with [`create `].
8989 #[ repr( transparent) ]
9090 #[ derive( Copy , Clone , Eq , PartialEq , Hash , Debug ) ]
9191 pub struct CreateFlags : u32 {
@@ -157,6 +157,11 @@ bitflags! {
157157///
158158/// Use the [`CreateFlags::CLOEXEC`] flag to prevent the resulting file
159159/// descriptor from being implicitly passed across `exec` boundaries.
160+ ///
161+ /// # References
162+ /// - [Linux]
163+ ///
164+ /// [Linux]: https://man7.org/linux/man-pages/man2/epoll_create.2.html
160165#[ inline]
161166#[ doc( alias = "epoll_create1" ) ]
162167pub fn create ( flags : CreateFlags ) -> io:: Result < OwnedFd > {
@@ -171,12 +176,17 @@ pub fn create(flags: CreateFlags) -> io::Result<OwnedFd> {
171176/// This registers interest in any of the events set in `events` occurring on
172177/// the file descriptor associated with `data`.
173178///
174- /// If [`delete`] is not called on the I/O source passed into this function
175- /// before the I/O source is `close`d, then the `epoll` will act as if the I/O
176- /// source is still registered with it. This can lead to spurious events being
177- /// returned from [`wait`]. If a file descriptor is an
178- /// `Arc<dyn SystemResource>`, then `epoll` can be thought to maintain a
179- /// `Weak<dyn SystemResource>` to the file descriptor.
179+ /// Note that `close`ing a file descriptor does not necessarily unregister
180+ /// interest which can lead to spurious events being returned from [`wait`]. If
181+ /// a file descriptor is an `Arc<dyn SystemResource>`, then `epoll` can be
182+ /// thought to maintain a `Weak<dyn SystemResource>` to the file descriptor.
183+ /// Check the [faq] for details.
184+ ///
185+ /// # References
186+ /// - [Linux]
187+ ///
188+ /// [Linux]: https://man7.org/linux/man-pages/man2/epoll_ctl.2.html
189+ /// [faq]: https://man7.org/linux/man-pages/man7/epoll.7.html#:~:text=Will%20closing%20a%20file%20descriptor%20cause%20it%20to%20be%20removed%20from%20all%0A%20%20%20%20%20%20%20%20%20%20epoll%20interest%20lists%3F
180190#[ doc( alias = "epoll_ctl" ) ]
181191pub fn add (
182192 epoll : impl AsFd ,
@@ -209,6 +219,11 @@ pub fn add(
209219/// given epoll object.
210220///
211221/// This sets the events of interest with `target` to `events`.
222+ ///
223+ /// # References
224+ /// - [Linux]
225+ ///
226+ /// [Linux]: https://man7.org/linux/man-pages/man2/epoll_ctl.2.html
212227#[ doc( alias = "epoll_ctl" ) ]
213228pub fn modify (
214229 epoll : impl AsFd ,
@@ -240,6 +255,11 @@ pub fn modify(
240255
241256/// `epoll_ctl(self, EPOLL_CTL_DEL, target, NULL)`—Removes an element in a
242257/// given epoll object.
258+ ///
259+ /// # References
260+ /// - [Linux]
261+ ///
262+ /// [Linux]: https://man7.org/linux/man-pages/man2/epoll_ctl.2.html
243263#[ doc( alias = "epoll_ctl" ) ]
244264pub fn delete ( epoll : impl AsFd , source : impl AsFd ) -> io:: Result < ( ) > {
245265 // SAFETY: We're calling `epoll_ctl` via FFI and we know how it
@@ -260,6 +280,11 @@ pub fn delete(epoll: impl AsFd, source: impl AsFd) -> io::Result<()> {
260280///
261281/// For each event of interest, an element is written to `events`. On
262282/// success, this returns the number of written elements.
283+ ///
284+ /// # References
285+ /// - [Linux]
286+ ///
287+ /// [Linux]: https://man7.org/linux/man-pages/man2/epoll_wait.2.html
263288#[ cfg( feature = "alloc" ) ]
264289#[ cfg_attr( docsrs, doc( cfg( feature = "alloc" ) ) ) ]
265290pub fn wait ( epoll : impl AsFd , event_list : & mut EventVec , timeout : c:: c_int ) -> io:: Result < ( ) > {
0 commit comments