Skip to content

Commit

Permalink
fix: add an unimplemented fd_fdstat_get function to wasi
Browse files Browse the repository at this point in the history
  • Loading branch information
uhyo committed Dec 27, 2024
1 parent ba804de commit f59c57a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/wasi-preview1/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type WASIAPI = {
cookie: bigint,
ret_buf: number
) => number;
fd_fdstat_get: (fd: number, ret_buf: number) => number;
path_filestat_get: (
fd: number,
flags: number,
Expand Down
3 changes: 3 additions & 0 deletions packages/wasi-preview1/src/wasi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ export function initWASI(config: WASIConfig): WASIAPI & WASIMeta {
return handleFsError(e, debug);
}
},
fd_fdstat_get: (fd, ret_buf) => {
throw new Error("Function not implemented.");
},
random_get: (buf, buf_len): number => {
crypto.randomFillSync(new Uint8Array(memory(), buf, buf_len));
return 0;
Expand Down

0 comments on commit f59c57a

Please sign in to comment.