| author | |
| committer | |
| log | b297c2eae92f25af006cd909d25e98672d39eddc |
| tree | 478b1bb4f4da2f3b1d5912597bf354c6cdb8c345 |
| parent | 1667c937a0869cc266ce43b4ecbde4ad49ca23c5 |
2 files changed, 12 insertions(+), 1 deletions(-)
lib/std/os.zig+3-1| ... | ... | @@ -5269,7 +5269,9 @@ pub const PollError = error{ |
| 5269 | 5269 | |
| 5270 | 5270 | pub fn poll(fds: []pollfd, timeout: i32) PollError!usize { |
| 5271 | 5271 | while (true) { |
| 5272 | const rc = system.poll(fds.ptr, fds.len, timeout); | |
| 5272 | const fds_count = math.cast(nfds_t, fds.len) catch | |
| 5273 | return error.SystemResources; | |
| 5274 | const rc = system.poll(fds.ptr, fds_count, timeout); | |
| 5273 | 5275 | if (builtin.os.tag == .windows) { |
| 5274 | 5276 | if (rc == windows.ws2_32.SOCKET_ERROR) { |
| 5275 | 5277 | switch (windows.ws2_32.WSAGetLastError()) { |
lib/std/os/bits/freebsd.zig+9| ... | ... | @@ -1505,3 +1505,12 @@ pub const POLLRDBAND = 0x0080; |
| 1505 | 1505 | pub const POLLWRBAND = 0x0100; |
| 1506 | 1506 | /// like POLLIN, except ignore EOF. |
| 1507 | 1507 | pub const POLLINIGNEOF = 0x2000; |
| 1508 | /// some poll error occurred. | |
| 1509 | pub const POLLERR = 0x0008; | |
| 1510 | /// file descriptor was "hung up". | |
| 1511 | pub const POLLHUP = 0x0010; | |
| 1512 | /// requested events "invalid". | |
| 1513 | pub const POLLNVAL = 0x0020; | |
| 1514 | ||
| 1515 | pub const POLLSTANDARD = POLLIN | POLLPRI | POLLOUT | POLLRDNORM | POLLRDBAND | | |
| 1516 | POLLWRBAND | POLLERR | POLLHUP | POLLNVAL; |