diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2026-02-08 14:13:20 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2026-02-08 14:13:20 +0100 |
| commit | 5bf30b2d562dd7b746a351dce333914e2ca958c8 (patch) | |
| tree | c272c0db39883ad3f962e540950821772a5c0d7f | |
| parent | b16ca5a986c129500285c238bbe1d3e0dd44e75e (diff) | |
Fix os2 file_wasi
| -rw-r--r-- | core/os/os2/file_wasi.odin | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/os/os2/file_wasi.odin b/core/os/os2/file_wasi.odin index 1333ecf20..78aa90699 100644 --- a/core/os/os2/file_wasi.odin +++ b/core/os/os2/file_wasi.odin @@ -41,7 +41,6 @@ init_std_files :: proc "contextless" () { data = impl, procedure = _file_stream_proc, } - impl.file.fstat = _fstat return &impl.file } @@ -222,7 +221,6 @@ _new_file :: proc(handle: uintptr, name: string, allocator: runtime.Allocator) - data = impl, procedure = _file_stream_proc, } - impl.file.fstat = _fstat return &impl.file, nil } @@ -434,7 +432,7 @@ _exists :: proc(path: string) -> bool { return true } -_file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offset: i64, whence: io.Seek_From) -> (n: i64, err: io.Error) { +_file_stream_proc :: proc(stream_data: rawptr, mode: File_Stream_Mode, p: []byte, offset: i64, whence: io.Seek_From, allocator: runtime.Allocator) -> (n: i64, err: Error) { f := (^File_Impl)(stream_data) fd := f.fd @@ -562,6 +560,10 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, case .Query: return io.query_utility({.Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Flush, .Close, .Destroy, .Query}) + case .Fstat: + err = file_stream_fstat_utility(f, p, allocator) + return + case: return 0, .Unsupported } |