Expand description
A minimal, safe epoll primitive for the QUIC-mimicry driver (3c.1).
yipd is #![forbid(unsafe_code)], but the QUIC pump (bin/yipd/src/quic.rs)
needs the same “wait on UDP + TUN with a caller-chosen timeout” capability
that crate::poll::run_poll has — except quinn-proto’s decoupled I/O
and dynamic timers want the loop outside yip-io, with the driver choosing
min(Connection::poll_timeout(), 10ms) per iteration. This module exposes
exactly that as a small safe wrapper (Epoll) so all the epoll/fcntl
unsafe stays here, in the one crate permitted to hold it.
This is intentionally not an event loop — it only blocks until one of the two fds is readable (or the timeout fires) and reports which. The driver owns the recv/send/timer logic.
Structs§
- Epoll
- An
epollinstance watching a UDP socket fd and a TUN/TAP fd forEPOLLIN. - Ready
- Which of the two watched fds became readable in the last
Epoll::wait.
Functions§
- read_fd
- Read from a raw fd into
buf, returning the number of bytes read. - set_
nonblocking - Set a file descriptor to non-blocking mode via
fcntl(O_NONBLOCK). - write_
fd - Write
bufto a raw fd, returning the number of bytes written.