| ... | @@ -2086,6 +2086,7 @@ fn fileLength(userdata: ?*anyopaque, file: File) File.LengthError!u64 { | ... | @@ -2086,6 +2086,7 @@ fn fileLength(userdata: ?*anyopaque, file: File) File.LengthError!u64 { |
| 2086 | switch (linux.errno(linux.statx(file.handle, "", linux.AT.EMPTY_PATH, .{ .SIZE = true }, &statx))) { | 2086 | switch (linux.errno(linux.statx(file.handle, "", linux.AT.EMPTY_PATH, .{ .SIZE = true }, &statx))) { |
| 2087 | .SUCCESS => { | 2087 | .SUCCESS => { |
| 2088 | current_thread.endSyscall(); | 2088 | current_thread.endSyscall(); |
| | 2089 | if (!statx.mask.SIZE) return error.Unexpected; |
| 2089 | return statx.size; | 2090 | return statx.size; |
| 2090 | }, | 2091 | }, |
| 2091 | .INTR => { | 2092 | .INTR => { |
| ... | @@ -5431,7 +5432,7 @@ fn fchmodatFallback( | ... | @@ -5431,7 +5432,7 @@ fn fchmodatFallback( |
| 5431 | switch (sys.errno(sys.statx(path_fd, "", posix.AT.EMPTY_PATH, .{ .TYPE = true }, &statx))) { | 5432 | switch (sys.errno(sys.statx(path_fd, "", posix.AT.EMPTY_PATH, .{ .TYPE = true }, &statx))) { |
| 5432 | .SUCCESS => { | 5433 | .SUCCESS => { |
| 5433 | current_thread.endSyscall(); | 5434 | current_thread.endSyscall(); |
| 5434 | assert(statx.mask.TYPE); | 5435 | if (!statx.mask.TYPE) return error.Unexpected; |
| 5435 | break statx.mode; | 5436 | break statx.mode; |
| 5436 | }, | 5437 | }, |
| 5437 | .INTR => { | 5438 | .INTR => { |
| ... | @@ -11112,15 +11113,15 @@ fn clockToWasi(clock: Io.Clock) std.os.wasi.clockid_t { | ... | @@ -11112,15 +11113,15 @@ fn clockToWasi(clock: Io.Clock) std.os.wasi.clockid_t { |
| 11112 | }; | 11113 | }; |
| 11113 | } | 11114 | } |
| 11114 | | 11115 | |
| 11115 | fn statFromLinux(stx: *const std.os.linux.Statx) File.Stat { | 11116 | fn statFromLinux(stx: *const std.os.linux.Statx) Io.UnexpectedError!File.Stat { |
| 11116 | assert(stx.mask.TYPE); | 11117 | if (!stx.mask.TYPE) return error.Unexpected; |
| 11117 | assert(stx.mask.MODE); | 11118 | if (!stx.mask.MODE) return error.Unexpected; |
| 11118 | assert(stx.mask.ATIME); | 11119 | if (!stx.mask.ATIME) return error.Unexpected; |
| 11119 | assert(stx.mask.MTIME); | 11120 | if (!stx.mask.MTIME) return error.Unexpected; |
| 11120 | assert(stx.mask.CTIME); | 11121 | if (!stx.mask.CTIME) return error.Unexpected; |
| 11121 | assert(stx.mask.INO); | 11122 | if (!stx.mask.INO) return error.Unexpected; |
| 11122 | assert(stx.mask.SIZE); | 11123 | if (!stx.mask.SIZE) return error.Unexpected; |
| 11123 | assert(stx.mask.NLINK); | 11124 | if (!stx.mask.NLINK) return error.Unexpected; |
| 11124 | const atime = stx.atime; | 11125 | const atime = stx.atime; |
| 11125 | const mtime = stx.mtime; | 11126 | const mtime = stx.mtime; |
| 11126 | const ctime = stx.ctime; | 11127 | const ctime = stx.ctime; |