| ... | @@ -1027,6 +1027,7 @@ pub const WriteError = error{ | ... | @@ -1027,6 +1027,7 @@ pub const WriteError = error{ |
| 1027 | InputOutput, | 1027 | InputOutput, |
| 1028 | NoSpaceLeft, | 1028 | NoSpaceLeft, |
| 1029 | DeviceBusy, | 1029 | DeviceBusy, |
| | 1030 | InvalidArgument, |
| 1030 | | 1031 | |
| 1031 | /// In WASI, this error may occur when the file descriptor does | 1032 | /// In WASI, this error may occur when the file descriptor does |
| 1032 | /// not hold the required rights to write to it. | 1033 | /// not hold the required rights to write to it. |
| ... | @@ -1113,7 +1114,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { | ... | @@ -1113,7 +1114,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { |
| 1113 | switch (errno(rc)) { | 1114 | switch (errno(rc)) { |
| 1114 | .SUCCESS => return @intCast(usize, rc), | 1115 | .SUCCESS => return @intCast(usize, rc), |
| 1115 | .INTR => continue, | 1116 | .INTR => continue, |
| 1116 | .INVAL => unreachable, | 1117 | .INVAL => return error.InvalidArgument, |
| 1117 | .FAULT => unreachable, | 1118 | .FAULT => unreachable, |
| 1118 | .AGAIN => return error.WouldBlock, | 1119 | .AGAIN => return error.WouldBlock, |
| 1119 | .BADF => return error.NotOpenForWriting, // can be a race condition. | 1120 | .BADF => return error.NotOpenForWriting, // can be a race condition. |
| ... | @@ -1183,7 +1184,7 @@ pub fn writev(fd: fd_t, iov: []const iovec_const) WriteError!usize { | ... | @@ -1183,7 +1184,7 @@ pub fn writev(fd: fd_t, iov: []const iovec_const) WriteError!usize { |
| 1183 | switch (errno(rc)) { | 1184 | switch (errno(rc)) { |
| 1184 | .SUCCESS => return @intCast(usize, rc), | 1185 | .SUCCESS => return @intCast(usize, rc), |
| 1185 | .INTR => continue, | 1186 | .INTR => continue, |
| 1186 | .INVAL => unreachable, | 1187 | .INVAL => return error.InvalidArgument, |
| 1187 | .FAULT => unreachable, | 1188 | .FAULT => unreachable, |
| 1188 | .AGAIN => return error.WouldBlock, | 1189 | .AGAIN => return error.WouldBlock, |
| 1189 | .BADF => return error.NotOpenForWriting, // Can be a race condition. | 1190 | .BADF => return error.NotOpenForWriting, // Can be a race condition. |
| ... | @@ -1278,7 +1279,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { | ... | @@ -1278,7 +1279,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { |
| 1278 | switch (errno(rc)) { | 1279 | switch (errno(rc)) { |
| 1279 | .SUCCESS => return @intCast(usize, rc), | 1280 | .SUCCESS => return @intCast(usize, rc), |
| 1280 | .INTR => continue, | 1281 | .INTR => continue, |
| 1281 | .INVAL => unreachable, | 1282 | .INVAL => return error.InvalidArgument, |
| 1282 | .FAULT => unreachable, | 1283 | .FAULT => unreachable, |
| 1283 | .AGAIN => return error.WouldBlock, | 1284 | .AGAIN => return error.WouldBlock, |
| 1284 | .BADF => return error.NotOpenForWriting, // Can be a race condition. | 1285 | .BADF => return error.NotOpenForWriting, // Can be a race condition. |
| ... | @@ -1368,7 +1369,7 @@ pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usiz | ... | @@ -1368,7 +1369,7 @@ pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usiz |
| 1368 | switch (errno(rc)) { | 1369 | switch (errno(rc)) { |
| 1369 | .SUCCESS => return @intCast(usize, rc), | 1370 | .SUCCESS => return @intCast(usize, rc), |
| 1370 | .INTR => continue, | 1371 | .INTR => continue, |
| 1371 | .INVAL => unreachable, | 1372 | .INVAL => return error.InvalidArgument, |
| 1372 | .FAULT => unreachable, | 1373 | .FAULT => unreachable, |
| 1373 | .AGAIN => return error.WouldBlock, | 1374 | .AGAIN => return error.WouldBlock, |
| 1374 | .BADF => return error.NotOpenForWriting, // Can be a race condition. | 1375 | .BADF => return error.NotOpenForWriting, // Can be a race condition. |