MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / wait

Function wait

src/event/epoll.rs:207–216  ·  view source on GitHub ↗
(
    epoll: EpollFd,
    mut event_list: Buf,
    timeout: Option<&Timespec>,
)

Source from the content-addressed store, hash-verified

205#[doc(alias = "epoll_wait")]
206#[inline]
207pub fn wait<EpollFd: AsFd, Buf: Buffer<Event>>(
208 epoll: EpollFd,
209 mut event_list: Buf,
210 timeout: Option<&Timespec>,
211) -> io::Result<Buf::Output> {
212 // SAFETY: `epoll_wait` behaves.
213 let nfds = unsafe { syscalls::epoll_wait(epoll.as_fd(), event_list.parts_mut(), timeout)? };
214 // SAFETY: `epoll_wait` behaves.
215 unsafe { Ok(event_list.assume_init(nfds)) }
216}
217
218/// A record of an event that occurred.
219#[repr(C)]

Callers 5

test_wait_wakeFunction · 0.50
test_wait_timeoutFunction · 0.50
serverFunction · 0.50
epoll_timeout_nsecsFunction · 0.50
epoll_timeout_secsFunction · 0.50

Calls 4

parts_mutMethod · 0.80
assume_initMethod · 0.80
epoll_waitFunction · 0.50
as_fdMethod · 0.45

Tested by 4

test_wait_wakeFunction · 0.40
test_wait_timeoutFunction · 0.40
epoll_timeout_nsecsFunction · 0.40
epoll_timeout_secsFunction · 0.40