| ... | ... | @@ -2243,7 +2243,8 @@ pub const SeekError = error{ |
| 2243 | 2243 | /// Repositions read/write file offset relative to the beginning. |
| 2244 | 2244 | pub fn lseek_SET(fd: fd_t, offset: u64) SeekError!void { |
| 2245 | 2245 | if (linux.is_the_target and !builtin.link_libc and @sizeOf(usize) == 4) { |
| 2246 | | switch (errno(system.llseek(fd, offset, null, SEEK_SET))) { |
| 2246 | var result: u64 = undefined; |
| 2247 | switch (errno(system.llseek(fd, offset, &result, SEEK_SET))) { |
| 2247 | 2248 | 0 => return, |
| 2248 | 2249 | EBADF => unreachable, // always a race condition |
| 2249 | 2250 | EINVAL => return error.Unseekable, |
| ... | ... | @@ -2271,7 +2272,8 @@ pub fn lseek_SET(fd: fd_t, offset: u64) SeekError!void { |
| 2271 | 2272 | /// Repositions read/write file offset relative to the current offset. |
| 2272 | 2273 | pub fn lseek_CUR(fd: fd_t, offset: i64) SeekError!void { |
| 2273 | 2274 | if (linux.is_the_target and !builtin.link_libc and @sizeOf(usize) == 4) { |
| 2274 | | switch (errno(system.llseek(fd, @bitCast(u64, offset), null, SEEK_CUR))) { |
| 2275 | var result: u64 = undefined; |
| 2276 | switch (errno(system.llseek(fd, @bitCast(u64, offset), &result, SEEK_CUR))) { |
| 2275 | 2277 | 0 => return, |
| 2276 | 2278 | EBADF => unreachable, // always a race condition |
| 2277 | 2279 | EINVAL => return error.Unseekable, |
| ... | ... | @@ -2298,7 +2300,9 @@ pub fn lseek_CUR(fd: fd_t, offset: i64) SeekError!void { |
| 2298 | 2300 | /// Repositions read/write file offset relative to the end. |
| 2299 | 2301 | pub fn lseek_END(fd: fd_t, offset: i64) SeekError!void { |
| 2300 | 2302 | if (linux.is_the_target and !builtin.link_libc and @sizeOf(usize) == 4) { |
| 2301 | | switch (errno(system.llseek(fd, @bitCast(u64, offset), null, SEEK_END))) { |
| 2303 | var result: u64 = undefined; |
| 2304 | switch (errno(system.llseek(fd, @bitCast(u64, offset), &result, SEEK_END))) { |
| 2305 | 0 => return, |
| 2302 | 2306 | EBADF => unreachable, // always a race condition |
| 2303 | 2307 | EINVAL => return error.Unseekable, |
| 2304 | 2308 | EOVERFLOW => return error.Unseekable, |