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 {
if (@hasField(SYS, "poll")) {
return syscall3(.poll, @intFromPtr(fds), n, @as(u32, @bitCast(timeout)));
} else {
return syscall5(
.ppoll,
@intFromPtr(fds),
n,
@intFromPtr(if (timeout >= 0)
×pec{
.sec = @divTrunc(timeout, 1000),
.nsec = @rem(timeout, 1000) * 1000000,
}
else
null),
0,
NSIG / 8,
);
}
}