|
|
|
@ -120,7 +120,6 @@ uint32_t m3_wasi_unstable_args_get(IM3Module module,
|
|
|
|
|
uint32_t argv_offset,
|
|
|
|
|
uint32_t argv_buf_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
return __WASI_ESUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -128,7 +127,6 @@ uint32_t m3_wasi_unstable_args_sizes_get(IM3Module module,
|
|
|
|
|
uint32_t argc_offset,
|
|
|
|
|
uint32_t argv_buf_size_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
wasi_size_t *argc = offset2addr(module, argc_offset);
|
|
|
|
|
wasi_size_t *argv_buf_size = offset2addr(module, argv_buf_size_offset);
|
|
|
|
|
|
|
|
|
@ -141,7 +139,6 @@ uint32_t m3_wasi_unstable_environ_get(IM3Module module,
|
|
|
|
|
uint32_t environ_ptrs_offset,
|
|
|
|
|
uint32_t environ_strs_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
return __WASI_ESUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -149,7 +146,6 @@ uint32_t m3_wasi_unstable_environ_sizes_get(IM3Module module,
|
|
|
|
|
uint32_t environ_count_offset,
|
|
|
|
|
uint32_t environ_buf_size_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
wasi_size_t *environ_count = offset2addr(module, environ_count_offset);
|
|
|
|
|
wasi_size_t *environ_buf_size = offset2addr(module, environ_buf_size_offset);
|
|
|
|
|
*environ_count = 0;
|
|
|
|
@ -182,7 +178,6 @@ uint32_t m3_wasi_unstable_fd_fdstat_get(IM3Module module,
|
|
|
|
|
__wasi_fd_t fd,
|
|
|
|
|
uint32_t fdstat_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
struct stat fd_stat;
|
|
|
|
|
__wasi_fdstat_t *fdstat = offset2addr(module, fdstat_offset);
|
|
|
|
|
int fl = fcntl(fd, F_GETFL);
|
|
|
|
@ -211,7 +206,6 @@ uint32_t m3_wasi_unstable_fd_seek(IM3Module module,
|
|
|
|
|
__wasi_whence_t whence,
|
|
|
|
|
uint32_t newoffset_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
__wasi_filesize_t *result = offset2addr(module, newoffset_offset);
|
|
|
|
|
|
|
|
|
|
int wasi_whence = whence == __WASI_WHENCE_END ? SEEK_END :
|
|
|
|
@ -228,7 +222,6 @@ uint32_t m3_wasi_unstable_fd_read(IM3Module module,
|
|
|
|
|
size_t iovs_len,
|
|
|
|
|
uint32_t nread_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
struct iovec iovs[iovs_len];
|
|
|
|
|
copy_iov_to_host(iovs, module, iovs_offset, iovs_len);
|
|
|
|
|
size_t *nread = offset2addr(module, nread_offset);
|
|
|
|
@ -245,7 +238,6 @@ uint32_t m3_wasi_unstable_fd_write(IM3Module module,
|
|
|
|
|
size_t iovs_len,
|
|
|
|
|
uint32_t nwritten_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
struct iovec iovs[iovs_len];
|
|
|
|
|
copy_iov_to_host(iovs, module, iovs_offset, iovs_len);
|
|
|
|
|
size_t *nwritten = offset2addr(module, nwritten_offset);
|
|
|
|
@ -258,14 +250,12 @@ uint32_t m3_wasi_unstable_fd_write(IM3Module module,
|
|
|
|
|
|
|
|
|
|
uint32_t m3_wasi_unstable_fd_close(uint32_t fd)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
int ret = close(fd);
|
|
|
|
|
return ret == 0 ? __WASI_ESUCCESS : ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t m3_wasi_unstable_fd_datasync(uint32_t fd)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
int ret = fdatasync(fd);
|
|
|
|
|
return ret == 0 ? __WASI_ESUCCESS : ret;
|
|
|
|
|
}
|
|
|
|
@ -275,7 +265,6 @@ uint32_t m3_wasi_unstable_clock_time_get(IM3Module module,
|
|
|
|
|
uint64_t precision,
|
|
|
|
|
uint32_t time_offset)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
uint64_t *time = offset2addr(module, time_offset);
|
|
|
|
|
struct timespec tp;
|
|
|
|
|
clock_gettime(clock_id, &tp);
|
|
|
|
@ -285,7 +274,6 @@ uint32_t m3_wasi_unstable_clock_time_get(IM3Module module,
|
|
|
|
|
|
|
|
|
|
uint32_t m3_wasi_unstable_proc_exit(uint32_t code)
|
|
|
|
|
{
|
|
|
|
|
printf("=> %s\n", __FUNCTION__);
|
|
|
|
|
exit(code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|