+ implemented WASI file close

git-svn-id: branches/wasm@48344 -
This commit is contained in:
nickysn 2021-01-23 07:04:32 +00:00
parent 8e2e31f95c
commit a28eb39f4b
2 changed files with 10 additions and 1 deletions

View File

@ -14,8 +14,16 @@
**********************************************************************}
procedure Do_Close(Handle:thandle);
var
res: __wasi_errno_t;
begin
DebugWriteLn('Do_Close');
repeat
res:=fd_close(Handle);
until (res=__WASI_ERRNO_SUCCESS) or (res<>__WASI_ERRNO_INTR);
if res=__WASI_ERRNO_SUCCESS then
InOutRes:=0
else
InOutRes:=Errno2InoutRes(res);
end;
procedure Do_Erase(p: pchar; pchangeable: boolean);

View File

@ -244,6 +244,7 @@ function path_open(fd: __wasi_fd_t;
fs_rights_inherting: __wasi_rights_t;
fdflags: __wasi_fdflags_t;
opened_fd: P__wasi_fd_t): __wasi_errno_t; external 'wasi_snapshot_preview1';
function fd_close(fd: __wasi_fd_t): __wasi_errno_t; external 'wasi_snapshot_preview1';
{$I system.inc}