| ... | @@ -2298,7 +2298,7 @@ pub const ChangeCurDirError = error{ | ... | @@ -2298,7 +2298,7 @@ pub const ChangeCurDirError = error{ |
| 2298 | SystemResources, | 2298 | SystemResources, |
| 2299 | NotDir, | 2299 | NotDir, |
| 2300 | BadPathName, | 2300 | BadPathName, |
| 2301 | | 2301 | |
| 2302 | /// On Windows, file paths must be valid Unicode. | 2302 | /// On Windows, file paths must be valid Unicode. |
| 2303 | InvalidUtf8, | 2303 | InvalidUtf8, |
| 2304 | } || UnexpectedError; | 2304 | } || UnexpectedError; |
| ... | @@ -5250,6 +5250,32 @@ pub fn poll(fds: []pollfd, timeout: i32) PollError!usize { | ... | @@ -5250,6 +5250,32 @@ pub fn poll(fds: []pollfd, timeout: i32) PollError!usize { |
| 5250 | } | 5250 | } |
| 5251 | } | 5251 | } |
| 5252 | | 5252 | |
| | 5253 | pub const PPollError = error{ |
| | 5254 | /// The operation was interrupted by a delivery of a signal before it could complete. |
| | 5255 | SignalInterrupt, |
| | 5256 | |
| | 5257 | /// The kernel had no space to allocate file descriptor tables. |
| | 5258 | SystemResources, |
| | 5259 | } || UnexpectedError; |
| | 5260 | |
| | 5261 | pub fn ppoll(fds: []pollfd, timeout: ?*const timespec, mask: ?*const sigset_t) PPollError!usize { |
| | 5262 | var ts: timespec = undefined; |
| | 5263 | var ts_ptr: ?*timespec = null; |
| | 5264 | if (timeout) |timeout_ns| { |
| | 5265 | ts_ptr = &ts; |
| | 5266 | ts = timeout_ns.*; |
| | 5267 | } |
| | 5268 | const rc = system.ppoll(fds.ptr, fds.len, ts_ptr, mask); |
| | 5269 | switch (errno(rc)) { |
| | 5270 | 0 => return @intCast(usize, rc), |
| | 5271 | EFAULT => unreachable, |
| | 5272 | EINTR => return error.SignalInterrupt, |
| | 5273 | EINVAL => unreachable, |
| | 5274 | ENOMEM => return error.SystemResources, |
| | 5275 | else => |err| return unexpectedErrno(err), |
| | 5276 | } |
| | 5277 | } |
| | 5278 | |
| 5253 | pub const RecvFromError = error{ | 5279 | pub const RecvFromError = error{ |
| 5254 | /// The socket is marked nonblocking and the requested operation would block, and | 5280 | /// The socket is marked nonblocking and the requested operation would block, and |
| 5255 | /// there is no global event loop configured. | 5281 | /// there is no global event loop configured. |
| ... | @@ -5565,7 +5591,7 @@ pub fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) !fd_t { | ... | @@ -5565,7 +5591,7 @@ pub fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) !fd_t { |
| 5565 | EMFILE => return error.ProcessResources, | 5591 | EMFILE => return error.ProcessResources, |
| 5566 | ENODEV => return error.InodeMountFail, | 5592 | ENODEV => return error.InodeMountFail, |
| 5567 | ENOSYS => return error.SystemOutdated, | 5593 | ENOSYS => return error.SystemOutdated, |
| 5568 | else => |err| return std.os.unexpectedErrno(err), | 5594 | else => |err| return unexpectedErrno(err), |
| 5569 | } | 5595 | } |
| 5570 | } | 5596 | } |
| 5571 | | 5597 | |
| ... | @@ -5590,7 +5616,7 @@ pub fn syncfs(fd: fd_t) SyncError!void { | ... | @@ -5590,7 +5616,7 @@ pub fn syncfs(fd: fd_t) SyncError!void { |
| 5590 | EIO => return error.InputOutput, | 5616 | EIO => return error.InputOutput, |
| 5591 | ENOSPC => return error.NoSpaceLeft, | 5617 | ENOSPC => return error.NoSpaceLeft, |
| 5592 | EDQUOT => return error.DiskQuota, | 5618 | EDQUOT => return error.DiskQuota, |
| 5593 | else => |err| return std.os.unexpectedErrno(err), | 5619 | else => |err| return unexpectedErrno(err), |
| 5594 | } | 5620 | } |
| 5595 | } | 5621 | } |
| 5596 | | 5622 | |
| ... | @@ -5614,7 +5640,7 @@ pub fn fsync(fd: fd_t) SyncError!void { | ... | @@ -5614,7 +5640,7 @@ pub fn fsync(fd: fd_t) SyncError!void { |
| 5614 | EIO => return error.InputOutput, | 5640 | EIO => return error.InputOutput, |
| 5615 | ENOSPC => return error.NoSpaceLeft, | 5641 | ENOSPC => return error.NoSpaceLeft, |
| 5616 | EDQUOT => return error.DiskQuota, | 5642 | EDQUOT => return error.DiskQuota, |
| 5617 | else => |err| return std.os.unexpectedErrno(err), | 5643 | else => |err| return unexpectedErrno(err), |
| 5618 | } | 5644 | } |
| 5619 | } | 5645 | } |
| 5620 | | 5646 | |
| ... | @@ -5633,7 +5659,7 @@ pub fn fdatasync(fd: fd_t) SyncError!void { | ... | @@ -5633,7 +5659,7 @@ pub fn fdatasync(fd: fd_t) SyncError!void { |
| 5633 | EIO => return error.InputOutput, | 5659 | EIO => return error.InputOutput, |
| 5634 | ENOSPC => return error.NoSpaceLeft, | 5660 | ENOSPC => return error.NoSpaceLeft, |
| 5635 | EDQUOT => return error.DiskQuota, | 5661 | EDQUOT => return error.DiskQuota, |
| 5636 | else => |err| return std.os.unexpectedErrno(err), | 5662 | else => |err| return unexpectedErrno(err), |
| 5637 | } | 5663 | } |
| 5638 | } | 5664 | } |
| 5639 | | 5665 | |
| ... | @@ -5675,7 +5701,7 @@ pub fn prctl(option: PR, args: anytype) PrctlError!u31 { | ... | @@ -5675,7 +5701,7 @@ pub fn prctl(option: PR, args: anytype) PrctlError!u31 { |
| 5675 | EOPNOTSUPP => return error.OperationNotSupported, | 5701 | EOPNOTSUPP => return error.OperationNotSupported, |
| 5676 | EPERM, EBUSY => return error.PermissionDenied, | 5702 | EPERM, EBUSY => return error.PermissionDenied, |
| 5677 | ERANGE => unreachable, | 5703 | ERANGE => unreachable, |
| 5678 | else => |err| return std.os.unexpectedErrno(err), | 5704 | else => |err| return unexpectedErrno(err), |
| 5679 | } | 5705 | } |
| 5680 | } | 5706 | } |
| 5681 | | 5707 | |
| ... | @@ -5688,7 +5714,7 @@ pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit { | ... | @@ -5688,7 +5714,7 @@ pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit { |
| 5688 | 0 => return limits, | 5714 | 0 => return limits, |
| 5689 | EFAULT => unreachable, // bogus pointer | 5715 | EFAULT => unreachable, // bogus pointer |
| 5690 | EINVAL => unreachable, | 5716 | EINVAL => unreachable, |
| 5691 | else => |err| return std.os.unexpectedErrno(err), | 5717 | else => |err| return unexpectedErrno(err), |
| 5692 | } | 5718 | } |
| 5693 | } | 5719 | } |
| 5694 | | 5720 | |
| ... | @@ -5701,6 +5727,6 @@ pub fn setrlimit(resource: rlimit_resource, limits: rlimit) SetrlimitError!void | ... | @@ -5701,6 +5727,6 @@ pub fn setrlimit(resource: rlimit_resource, limits: rlimit) SetrlimitError!void |
| 5701 | EFAULT => unreachable, // bogus pointer | 5727 | EFAULT => unreachable, // bogus pointer |
| 5702 | EINVAL => unreachable, | 5728 | EINVAL => unreachable, |
| 5703 | EPERM => return error.PermissionDenied, | 5729 | EPERM => return error.PermissionDenied, |
| 5704 | else => |err| return std.os.unexpectedErrno(err), | 5730 | else => |err| return unexpectedErrno(err), |
| 5705 | } | 5731 | } |
| 5706 | } | 5732 | } |