Function poll [src]
Prototype
pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize
Parameters
fds: [*]pollfd
n: nfds_t
timeout: i32
Source
pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize {
return if (@hasField(SYS, "poll"))
return syscall3(.poll, @intFromPtr(fds), n, @as(u32, @bitCast(timeout)))
else
ppoll(
fds,
n,
if (timeout >= 0)
@constCast(×pec{
.sec = @divTrunc(timeout, 1000),
.nsec = @rem(timeout, 1000) * 1000000,
})
else
null,
null,
);
}