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

Function getn

src/event/port.rs:157–168  ·  view source on GitHub ↗
(
    port: Fd,
    mut events: Buf,
    min_events: u32,
    timeout: Option<&Timespec>,
)

Source from the content-addressed store, hash-verified

155/// [illumos]: https://illumos.org/man/3C/port_getn
156#[doc(alias = "port_getn")]
157pub fn getn<Fd: AsFd, Buf: Buffer<Event>>(
158 port: Fd,
159 mut events: Buf,
160 min_events: u32,
161 timeout: Option<&Timespec>,
162) -> io::Result<Buf::Output> {
163 // SAFETY: `port_getn` behaves.
164 let nevents =
165 unsafe { syscalls::port_getn(port.as_fd(), events.parts_mut(), min_events, timeout)? };
166 // SAFETY: `port_getn` behaves.
167 unsafe { Ok(events.assume_init(nevents)) }
168}
169
170/// `port_getn(port, NULL, 0, NULL)`—Queries the number of events
171/// available from a port.

Callers 1

mainFunction · 0.85

Calls 4

port_getnFunction · 0.85
parts_mutMethod · 0.80
assume_initMethod · 0.80
as_fdMethod · 0.45

Tested by

no test coverage detected