diff --git a/packages/wasi-preview1/src/api.ts b/packages/wasi-preview1/src/api.ts index 6e5f412..1edef97 100644 --- a/packages/wasi-preview1/src/api.ts +++ b/packages/wasi-preview1/src/api.ts @@ -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, diff --git a/packages/wasi-preview1/src/wasi.ts b/packages/wasi-preview1/src/wasi.ts index 186d8e8..3671307 100644 --- a/packages/wasi-preview1/src/wasi.ts +++ b/packages/wasi-preview1/src/wasi.ts @@ -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;