mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-26 03:09:08 +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;
|
||||
|
||||
function Do_Write(Handle:thandle;Addr:Pointer;Len:Longint):longint;
|
||||
var
|
||||
our_iov: __wasi_ciovec_t;
|
||||
our_nwritten: longint;
|
||||
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;
|
||||
|
||||
function Do_Read(Handle:thandle;Addr:Pointer;Len:Longint):Longint;
|
||||
|
@ -71,6 +71,11 @@ type
|
||||
buf_len: __wasi_size_t;
|
||||
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}
|
||||
|
||||
{$I system.inc}
|
||||
@ -127,10 +132,6 @@ begin
|
||||
end;
|
||||
{$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);
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user