1 | use crate::{backend, io}; |
2 | |
3 | pub use backend::event::poll_fd::{PollFd, PollFlags}; |
4 | |
5 | /// `poll(self.fds, timeout)` |
6 | /// |
7 | /// # References |
8 | /// - [Beej's Guide to Network Programming] |
9 | /// - [POSIX] |
10 | /// - [Linux] |
11 | /// - [Apple] |
12 | /// - [Winsock] |
13 | /// - [FreeBSD] |
14 | /// - [NetBSD] |
15 | /// - [OpenBSD] |
16 | /// - [DragonFly BSD] |
17 | /// - [illumos] |
18 | /// |
19 | /// [Beej's Guide to Network Programming]: https://beej.us/guide/bgnet/html/split/slightly-advanced-techniques.html#poll |
20 | /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html |
21 | /// [Linux]: https://man7.org/linux/man-pages/man2/poll.2.html |
22 | /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/poll.2.html |
23 | /// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll |
24 | /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=poll&sektion=2 |
25 | /// [NetBSD]: https://man.netbsd.org/poll.2 |
26 | /// [OpenBSD]: https://man.openbsd.org/poll.2 |
27 | /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=poll§ion=2 |
28 | /// [illumos]: https://illumos.org/man/2/poll |
29 | #[inline ] |
30 | pub fn poll(fds: &mut [PollFd<'_>], timeout: i32) -> io::Result<usize> { |
31 | backend::event::syscalls::poll(fds, timeout) |
32 | } |
33 | |