mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 01:39:42 +02:00
+ implemented WASI file close
git-svn-id: branches/wasm@48344 -
This commit is contained in:
parent
8e2e31f95c
commit
a28eb39f4b
@ -14,8 +14,16 @@
|
|||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
procedure Do_Close(Handle:thandle);
|
procedure Do_Close(Handle:thandle);
|
||||||
|
var
|
||||||
|
res: __wasi_errno_t;
|
||||||
begin
|
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;
|
end;
|
||||||
|
|
||||||
procedure Do_Erase(p: pchar; pchangeable: boolean);
|
procedure Do_Erase(p: pchar; pchangeable: boolean);
|
||||||
|
@ -244,6 +244,7 @@ function path_open(fd: __wasi_fd_t;
|
|||||||
fs_rights_inherting: __wasi_rights_t;
|
fs_rights_inherting: __wasi_rights_t;
|
||||||
fdflags: __wasi_fdflags_t;
|
fdflags: __wasi_fdflags_t;
|
||||||
opened_fd: P__wasi_fd_t): __wasi_errno_t; external 'wasi_snapshot_preview1';
|
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}
|
{$I system.inc}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user