mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 12:00:57 +02:00
+ implemented do_write for WASI. Error handling is not yet done.
git-svn-id: branches/wasm@48299 -
This commit is contained in:
parent
9b2e3aa251
commit
5794afac54
@ -34,8 +34,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function Do_Write(Handle:thandle;Addr:Pointer;Len:Longint):longint;
|
function Do_Write(Handle:thandle;Addr:Pointer;Len:Longint):longint;
|
||||||
|
var
|
||||||
|
our_iov: __wasi_ciovec_t;
|
||||||
|
our_nwritten: longint;
|
||||||
begin
|
begin
|
||||||
DebugWriteLn('Do_Write');
|
our_iov.buf := Addr;
|
||||||
|
our_iov.buf_len := Len;
|
||||||
|
fd_write(Handle, @our_iov, 1, @our_nwritten);
|
||||||
|
Do_Write:=our_nwritten;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Do_Read(Handle:thandle;Addr:Pointer;Len:Longint):Longint;
|
function Do_Read(Handle:thandle;Addr:Pointer;Len:Longint):Longint;
|
||||||
|
@ -71,6 +71,11 @@ type
|
|||||||
buf_len: __wasi_size_t;
|
buf_len: __wasi_size_t;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function fd_write(fd: __wasi_fd_t;
|
||||||
|
iovs: P__wasi_ciovec_t;
|
||||||
|
iovs_len: size_t;
|
||||||
|
nwritten: P__wasi_size_t): __wasi_errno_t; external 'wasi_unstable';
|
||||||
|
|
||||||
{$ifdef FULL_RTL}
|
{$ifdef FULL_RTL}
|
||||||
|
|
||||||
{$I system.inc}
|
{$I system.inc}
|
||||||
@ -127,10 +132,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$endif FULL_RTL}
|
{$endif FULL_RTL}
|
||||||
|
|
||||||
function fd_write(fd: __wasi_fd_t;
|
|
||||||
iovs: P__wasi_ciovec_t;
|
|
||||||
iovs_len: size_t;
|
|
||||||
nwritten: P__wasi_size_t): __wasi_errno_t; external 'wasi_unstable';
|
|
||||||
|
|
||||||
procedure DebugWrite(const P: PChar);
|
procedure DebugWrite(const P: PChar);
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user