diff --git a/lib/std/os.zig b/lib/std/os.zig index f167e47e2a9b0c96ba4f90d8775bde8a976ba1c9..66dbe195021589642f5eb3bfc688aa761035adbf 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -5823,7 +5823,8 @@ pub fn ppoll(fds: []pollfd, timeout: ?*const timespec, mask: ?*const sigset_t) P ts_ptr = &ts; ts = timeout_ns.*; } - const rc = system.ppoll(fds.ptr, fds.len, ts_ptr, mask); + const fds_count = math.cast(nfds_t, fds.len) catch return error.SystemResources; + const rc = system.ppoll(fds.ptr, fds_count, ts_ptr, mask); switch (errno(rc)) { .SUCCESS => return @intCast(usize, rc), .FAULT => unreachable,