Function rustix::event::epoll::add

source ·
pub fn add(
    epoll: impl AsFd,
    source: impl AsFd,
    data: EventData,
    event_flags: EventFlags,
) -> Result<()>
Expand description

epoll_ctl(self, EPOLL_CTL_ADD, data, event)—Adds an element to an epoll object.

This registers interest in any of the events set in event_flags occurring on the file descriptor associated with data.

Note that closeing a file descriptor does not necessarily unregister interest which can lead to spurious events being returned from epoll::wait. If a file descriptor is an Arc<dyn SystemResource>, then epoll can be thought to maintain a Weak<dyn SystemResource> to the file descriptor. Check the faq for details.

§References