|
|
@@ -335,7 +335,7 @@ wasi_fd_close(wasm_exec_env_t exec_env, wasi_fd_t fd)
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_close(curfds, prestats, fd);
|
|
|
+ return wasmtime_ssp_fd_close(exec_env, curfds, prestats, fd);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -348,7 +348,7 @@ wasi_fd_datasync(wasm_exec_env_t exec_env, wasi_fd_t fd)
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_datasync(curfds, fd);
|
|
|
+ return wasmtime_ssp_fd_datasync(exec_env, curfds, fd);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -389,8 +389,8 @@ wasi_fd_pread(wasm_exec_env_t exec_env, wasi_fd_t fd, iovec_app_t *iovec_app,
|
|
|
iovec->buf_len = iovec_app->buf_len;
|
|
|
}
|
|
|
|
|
|
- err = wasmtime_ssp_fd_pread(curfds, fd, iovec_begin, iovs_len, offset,
|
|
|
- &nread);
|
|
|
+ err = wasmtime_ssp_fd_pread(exec_env, curfds, fd, iovec_begin, iovs_len,
|
|
|
+ offset, &nread);
|
|
|
if (err)
|
|
|
goto fail;
|
|
|
|
|
|
@@ -443,8 +443,8 @@ wasi_fd_pwrite(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
ciovec->buf_len = iovec_app->buf_len;
|
|
|
}
|
|
|
|
|
|
- err = wasmtime_ssp_fd_pwrite(curfds, fd, ciovec_begin, iovs_len, offset,
|
|
|
- &nwritten);
|
|
|
+ err = wasmtime_ssp_fd_pwrite(exec_env, curfds, fd, ciovec_begin, iovs_len,
|
|
|
+ offset, &nwritten);
|
|
|
if (err)
|
|
|
goto fail;
|
|
|
|
|
|
@@ -496,7 +496,8 @@ wasi_fd_read(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
iovec->buf_len = iovec_app->buf_len;
|
|
|
}
|
|
|
|
|
|
- err = wasmtime_ssp_fd_read(curfds, fd, iovec_begin, iovs_len, &nread);
|
|
|
+ err = wasmtime_ssp_fd_read(exec_env, curfds, fd, iovec_begin, iovs_len,
|
|
|
+ &nread);
|
|
|
if (err)
|
|
|
goto fail;
|
|
|
|
|
|
@@ -521,7 +522,7 @@ wasi_fd_renumber(wasm_exec_env_t exec_env, wasi_fd_t from, wasi_fd_t to)
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_renumber(curfds, prestats, from, to);
|
|
|
+ return wasmtime_ssp_fd_renumber(exec_env, curfds, prestats, from, to);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -538,7 +539,8 @@ wasi_fd_seek(wasm_exec_env_t exec_env, wasi_fd_t fd, wasi_filedelta_t offset,
|
|
|
if (!validate_native_addr(newoffset, sizeof(wasi_filesize_t)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_seek(curfds, fd, offset, whence, newoffset);
|
|
|
+ return wasmtime_ssp_fd_seek(exec_env, curfds, fd, offset, whence,
|
|
|
+ newoffset);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -554,7 +556,7 @@ wasi_fd_tell(wasm_exec_env_t exec_env, wasi_fd_t fd, wasi_filesize_t *newoffset)
|
|
|
if (!validate_native_addr(newoffset, sizeof(wasi_filesize_t)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_tell(curfds, fd, newoffset);
|
|
|
+ return wasmtime_ssp_fd_tell(exec_env, curfds, fd, newoffset);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -573,7 +575,7 @@ wasi_fd_fdstat_get(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!validate_native_addr(fdstat_app, sizeof(wasi_fdstat_t)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- err = wasmtime_ssp_fd_fdstat_get(curfds, fd, &fdstat);
|
|
|
+ err = wasmtime_ssp_fd_fdstat_get(exec_env, curfds, fd, &fdstat);
|
|
|
if (err)
|
|
|
return err;
|
|
|
|
|
|
@@ -592,7 +594,7 @@ wasi_fd_fdstat_set_flags(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_fdstat_set_flags(curfds, fd, flags);
|
|
|
+ return wasmtime_ssp_fd_fdstat_set_flags(exec_env, curfds, fd, flags);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -607,8 +609,8 @@ wasi_fd_fdstat_set_rights(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_fdstat_set_rights(curfds, fd, fs_rights_base,
|
|
|
- fs_rights_inheriting);
|
|
|
+ return wasmtime_ssp_fd_fdstat_set_rights(
|
|
|
+ exec_env, curfds, fd, fs_rights_base, fs_rights_inheriting);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -621,7 +623,7 @@ wasi_fd_sync(wasm_exec_env_t exec_env, wasi_fd_t fd)
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_sync(curfds, fd);
|
|
|
+ return wasmtime_ssp_fd_sync(exec_env, curfds, fd);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -663,7 +665,8 @@ wasi_fd_write(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
ciovec->buf_len = iovec_app->buf_len;
|
|
|
}
|
|
|
|
|
|
- err = wasmtime_ssp_fd_write(curfds, fd, ciovec_begin, iovs_len, &nwritten);
|
|
|
+ err = wasmtime_ssp_fd_write(exec_env, curfds, fd, ciovec_begin, iovs_len,
|
|
|
+ &nwritten);
|
|
|
if (err)
|
|
|
goto fail;
|
|
|
|
|
|
@@ -688,7 +691,7 @@ wasi_fd_advise(wasm_exec_env_t exec_env, wasi_fd_t fd, wasi_filesize_t offset,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_advise(curfds, fd, offset, len, advice);
|
|
|
+ return wasmtime_ssp_fd_advise(exec_env, curfds, fd, offset, len, advice);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -702,7 +705,7 @@ wasi_fd_allocate(wasm_exec_env_t exec_env, wasi_fd_t fd, wasi_filesize_t offset,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_allocate(curfds, fd, offset, len);
|
|
|
+ return wasmtime_ssp_fd_allocate(exec_env, curfds, fd, offset, len);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -716,7 +719,8 @@ wasi_path_create_directory(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_create_directory(curfds, fd, path, path_len);
|
|
|
+ return wasmtime_ssp_path_create_directory(exec_env, curfds, fd, path,
|
|
|
+ path_len);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -733,8 +737,9 @@ wasi_path_link(wasm_exec_env_t exec_env, wasi_fd_t old_fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_link(curfds, prestats, old_fd, old_flags, old_path,
|
|
|
- old_path_len, new_fd, new_path, new_path_len);
|
|
|
+ return wasmtime_ssp_path_link(exec_env, curfds, prestats, old_fd, old_flags,
|
|
|
+ old_path, old_path_len, new_fd, new_path,
|
|
|
+ new_path_len);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -756,9 +761,9 @@ wasi_path_open(wasm_exec_env_t exec_env, wasi_fd_t dirfd,
|
|
|
if (!validate_native_addr(fd_app, sizeof(wasi_fd_t)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- err = wasmtime_ssp_path_open(curfds, dirfd, dirflags, path, path_len,
|
|
|
- oflags, fs_rights_base, fs_rights_inheriting,
|
|
|
- fs_flags, &fd);
|
|
|
+ err = wasmtime_ssp_path_open(exec_env, curfds, dirfd, dirflags, path,
|
|
|
+ path_len, oflags, fs_rights_base,
|
|
|
+ fs_rights_inheriting, fs_flags, &fd);
|
|
|
|
|
|
*fd_app = fd;
|
|
|
return err;
|
|
|
@@ -780,7 +785,8 @@ wasi_fd_readdir(wasm_exec_env_t exec_env, wasi_fd_t fd, void *buf,
|
|
|
if (!validate_native_addr(bufused_app, sizeof(uint32)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- err = wasmtime_ssp_fd_readdir(curfds, fd, buf, buf_len, cookie, &bufused);
|
|
|
+ err = wasmtime_ssp_fd_readdir(exec_env, curfds, fd, buf, buf_len, cookie,
|
|
|
+ &bufused);
|
|
|
if (err)
|
|
|
return err;
|
|
|
|
|
|
@@ -805,8 +811,8 @@ wasi_path_readlink(wasm_exec_env_t exec_env, wasi_fd_t fd, const char *path,
|
|
|
if (!validate_native_addr(bufused_app, sizeof(uint32)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- err = wasmtime_ssp_path_readlink(curfds, fd, path, path_len, buf, buf_len,
|
|
|
- &bufused);
|
|
|
+ err = wasmtime_ssp_path_readlink(exec_env, curfds, fd, path, path_len, buf,
|
|
|
+ buf_len, &bufused);
|
|
|
if (err)
|
|
|
return err;
|
|
|
|
|
|
@@ -826,8 +832,9 @@ wasi_path_rename(wasm_exec_env_t exec_env, wasi_fd_t old_fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_rename(curfds, old_fd, old_path, old_path_len,
|
|
|
- new_fd, new_path, new_path_len);
|
|
|
+ return wasmtime_ssp_path_rename(exec_env, curfds, old_fd, old_path,
|
|
|
+ old_path_len, new_fd, new_path,
|
|
|
+ new_path_len);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -844,7 +851,7 @@ wasi_fd_filestat_get(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!validate_native_addr(filestat, sizeof(wasi_filestat_t)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_filestat_get(curfds, fd, filestat);
|
|
|
+ return wasmtime_ssp_fd_filestat_get(exec_env, curfds, fd, filestat);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -859,8 +866,8 @@ wasi_fd_filestat_set_times(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_filestat_set_times(curfds, fd, st_atim, st_mtim,
|
|
|
- fstflags);
|
|
|
+ return wasmtime_ssp_fd_filestat_set_times(exec_env, curfds, fd, st_atim,
|
|
|
+ st_mtim, fstflags);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -874,7 +881,7 @@ wasi_fd_filestat_set_size(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_fd_filestat_set_size(curfds, fd, st_size);
|
|
|
+ return wasmtime_ssp_fd_filestat_set_size(exec_env, curfds, fd, st_size);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -892,8 +899,8 @@ wasi_path_filestat_get(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!validate_native_addr(filestat, sizeof(wasi_filestat_t)))
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_filestat_get(curfds, fd, flags, path, path_len,
|
|
|
- filestat);
|
|
|
+ return wasmtime_ssp_path_filestat_get(exec_env, curfds, fd, flags, path,
|
|
|
+ path_len, filestat);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -909,8 +916,9 @@ wasi_path_filestat_set_times(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_filestat_set_times(
|
|
|
- curfds, fd, flags, path, path_len, st_atim, st_mtim, fstflags);
|
|
|
+ return wasmtime_ssp_path_filestat_set_times(exec_env, curfds, fd, flags,
|
|
|
+ path, path_len, st_atim,
|
|
|
+ st_mtim, fstflags);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -926,8 +934,8 @@ wasi_path_symlink(wasm_exec_env_t exec_env, const char *old_path,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_symlink(curfds, prestats, old_path, old_path_len,
|
|
|
- fd, new_path, new_path_len);
|
|
|
+ return wasmtime_ssp_path_symlink(exec_env, curfds, prestats, old_path,
|
|
|
+ old_path_len, fd, new_path, new_path_len);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -941,7 +949,7 @@ wasi_path_unlink_file(wasm_exec_env_t exec_env, wasi_fd_t fd, const char *path,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_unlink_file(curfds, fd, path, path_len);
|
|
|
+ return wasmtime_ssp_path_unlink_file(exec_env, curfds, fd, path, path_len);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -955,7 +963,8 @@ wasi_path_remove_directory(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
if (!wasi_ctx)
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
- return wasmtime_ssp_path_remove_directory(curfds, fd, path, path_len);
|
|
|
+ return wasmtime_ssp_path_remove_directory(exec_env, curfds, fd, path,
|
|
|
+ path_len);
|
|
|
}
|
|
|
|
|
|
#if WASM_ENABLE_THREAD_MGR != 0
|
|
|
@@ -1026,8 +1035,8 @@ execute_interruptible_poll_oneoff(
|
|
|
/* update timeout for clock subscription events */
|
|
|
update_clock_subscription_data(
|
|
|
in_copy, nsubscriptions, min_uint64(time_quant, timeout - elapsed));
|
|
|
- err = wasmtime_ssp_poll_oneoff(curfds, in_copy, out, nsubscriptions,
|
|
|
- nevents);
|
|
|
+ err = wasmtime_ssp_poll_oneoff(exec_env, curfds, in_copy, out,
|
|
|
+ nsubscriptions, nevents);
|
|
|
elapsed += time_quant;
|
|
|
|
|
|
if (err) {
|
|
|
@@ -1079,7 +1088,8 @@ wasi_poll_oneoff(wasm_exec_env_t exec_env, const wasi_subscription_t *in,
|
|
|
return (wasi_errno_t)-1;
|
|
|
|
|
|
#if WASM_ENABLE_THREAD_MGR == 0
|
|
|
- err = wasmtime_ssp_poll_oneoff(curfds, in, out, nsubscriptions, &nevents);
|
|
|
+ err = wasmtime_ssp_poll_oneoff(exec_env, curfds, in, out, nsubscriptions,
|
|
|
+ &nevents);
|
|
|
#else
|
|
|
err = execute_interruptible_poll_oneoff(curfds, in, out, nsubscriptions,
|
|
|
&nevents, exec_env);
|
|
|
@@ -1133,7 +1143,7 @@ wasi_sock_accept(wasm_exec_env_t exec_env, wasi_fd_t fd, wasi_fdflags_t flags,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_accept(curfds, fd, flags, fd_new);
|
|
|
+ return wasi_ssp_sock_accept(exec_env, curfds, fd, flags, fd_new);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1152,7 +1162,7 @@ wasi_sock_addr_local(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_addr_local(curfds, fd, addr);
|
|
|
+ return wasi_ssp_sock_addr_local(exec_env, curfds, fd, addr);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1171,7 +1181,7 @@ wasi_sock_addr_remote(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_addr_remote(curfds, fd, addr);
|
|
|
+ return wasi_ssp_sock_addr_remote(exec_env, curfds, fd, addr);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1192,8 +1202,8 @@ wasi_sock_addr_resolve(wasm_exec_env_t exec_env, const char *host,
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
ns_lookup_list = wasi_ctx_get_ns_lookup_list(wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_addr_resolve(curfds, ns_lookup_list, host, service,
|
|
|
- hints, addr_info, addr_info_size,
|
|
|
+ return wasi_ssp_sock_addr_resolve(exec_env, curfds, ns_lookup_list, host,
|
|
|
+ service, hints, addr_info, addr_info_size,
|
|
|
max_info_size);
|
|
|
}
|
|
|
|
|
|
@@ -1211,7 +1221,7 @@ wasi_sock_bind(wasm_exec_env_t exec_env, wasi_fd_t fd, wasi_addr_t *addr)
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
addr_pool = wasi_ctx_get_addr_pool(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_bind(curfds, addr_pool, fd, addr);
|
|
|
+ return wasi_ssp_sock_bind(exec_env, curfds, addr_pool, fd, addr);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1234,7 +1244,7 @@ wasi_sock_connect(wasm_exec_env_t exec_env, wasi_fd_t fd, wasi_addr_t *addr)
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
addr_pool = wasi_ctx_get_addr_pool(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_connect(curfds, addr_pool, fd, addr);
|
|
|
+ return wasi_ssp_sock_connect(exec_env, curfds, addr_pool, fd, addr);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1253,7 +1263,7 @@ wasi_sock_get_broadcast(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_broadcast(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_broadcast(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1272,7 +1282,7 @@ wasi_sock_get_keep_alive(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_keep_alive(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_keep_alive(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1292,7 +1302,8 @@ wasi_sock_get_linger(wasm_exec_env_t exec_env, wasi_fd_t fd, bool *is_enabled,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_linger(curfds, fd, is_enabled, linger_s);
|
|
|
+ return wasmtime_ssp_sock_get_linger(exec_env, curfds, fd, is_enabled,
|
|
|
+ linger_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1311,7 +1322,7 @@ wasi_sock_get_recv_buf_size(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_recv_buf_size(curfds, fd, size);
|
|
|
+ return wasmtime_ssp_sock_get_recv_buf_size(exec_env, curfds, fd, size);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1330,7 +1341,7 @@ wasi_sock_get_recv_timeout(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_recv_timeout(curfds, fd, timeout_us);
|
|
|
+ return wasmtime_ssp_sock_get_recv_timeout(exec_env, curfds, fd, timeout_us);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1349,7 +1360,7 @@ wasi_sock_get_reuse_addr(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_reuse_addr(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_reuse_addr(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1368,7 +1379,7 @@ wasi_sock_get_reuse_port(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_reuse_port(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_reuse_port(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1387,7 +1398,7 @@ wasi_sock_get_send_buf_size(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_send_buf_size(curfds, fd, size);
|
|
|
+ return wasmtime_ssp_sock_get_send_buf_size(exec_env, curfds, fd, size);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1406,7 +1417,7 @@ wasi_sock_get_send_timeout(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_send_timeout(curfds, fd, timeout_us);
|
|
|
+ return wasmtime_ssp_sock_get_send_timeout(exec_env, curfds, fd, timeout_us);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1425,7 +1436,8 @@ wasi_sock_get_tcp_fastopen_connect(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_tcp_fastopen_connect(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_tcp_fastopen_connect(exec_env, curfds, fd,
|
|
|
+ is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1444,7 +1456,7 @@ wasi_sock_get_tcp_no_delay(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_tcp_no_delay(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_tcp_no_delay(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1463,7 +1475,8 @@ wasi_sock_get_tcp_quick_ack(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_tcp_quick_ack(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_tcp_quick_ack(exec_env, curfds, fd,
|
|
|
+ is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1482,7 +1495,7 @@ wasi_sock_get_tcp_keep_idle(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_tcp_keep_idle(curfds, fd, time_s);
|
|
|
+ return wasmtime_ssp_sock_get_tcp_keep_idle(exec_env, curfds, fd, time_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1501,7 +1514,7 @@ wasi_sock_get_tcp_keep_intvl(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_tcp_keep_intvl(curfds, fd, time_s);
|
|
|
+ return wasmtime_ssp_sock_get_tcp_keep_intvl(exec_env, curfds, fd, time_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1520,7 +1533,7 @@ wasi_sock_get_ip_multicast_loop(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_ip_multicast_loop(curfds, fd, ipv6,
|
|
|
+ return wasmtime_ssp_sock_get_ip_multicast_loop(exec_env, curfds, fd, ipv6,
|
|
|
is_enabled);
|
|
|
}
|
|
|
|
|
|
@@ -1539,7 +1552,7 @@ wasi_sock_get_ip_ttl(wasm_exec_env_t exec_env, wasi_fd_t fd, uint8_t *ttl_s)
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_ip_ttl(curfds, fd, ttl_s);
|
|
|
+ return wasmtime_ssp_sock_get_ip_ttl(exec_env, curfds, fd, ttl_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1558,7 +1571,7 @@ wasi_sock_get_ip_multicast_ttl(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_ip_multicast_ttl(curfds, fd, ttl_s);
|
|
|
+ return wasmtime_ssp_sock_get_ip_multicast_ttl(exec_env, curfds, fd, ttl_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1577,7 +1590,7 @@ wasi_sock_get_ipv6_only(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_get_ipv6_only(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_get_ipv6_only(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1592,7 +1605,7 @@ wasi_sock_listen(wasm_exec_env_t exec_env, wasi_fd_t fd, uint32 backlog)
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_listen(curfds, fd, backlog);
|
|
|
+ return wasi_ssp_sock_listen(exec_env, curfds, fd, backlog);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1609,7 +1622,7 @@ wasi_sock_open(wasm_exec_env_t exec_env, wasi_fd_t poolfd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasi_ssp_sock_open(curfds, poolfd, af, socktype, sockfd);
|
|
|
+ return wasi_ssp_sock_open(exec_env, curfds, poolfd, af, socktype, sockfd);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1624,7 +1637,7 @@ wasi_sock_set_broadcast(wasm_exec_env_t exec_env, wasi_fd_t fd, bool is_enabled)
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_broadcast(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_broadcast(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1640,7 +1653,7 @@ wasi_sock_set_keep_alive(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_keep_alive(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_keep_alive(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1656,7 +1669,8 @@ wasi_sock_set_linger(wasm_exec_env_t exec_env, wasi_fd_t fd, bool is_enabled,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_linger(curfds, fd, is_enabled, linger_s);
|
|
|
+ return wasmtime_ssp_sock_set_linger(exec_env, curfds, fd, is_enabled,
|
|
|
+ linger_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1671,7 +1685,7 @@ wasi_sock_set_recv_buf_size(wasm_exec_env_t exec_env, wasi_fd_t fd, size_t size)
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_recv_buf_size(curfds, fd, size);
|
|
|
+ return wasmtime_ssp_sock_set_recv_buf_size(exec_env, curfds, fd, size);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1687,7 +1701,7 @@ wasi_sock_set_recv_timeout(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_recv_timeout(curfds, fd, timeout_us);
|
|
|
+ return wasmtime_ssp_sock_set_recv_timeout(exec_env, curfds, fd, timeout_us);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1703,7 +1717,7 @@ wasi_sock_set_reuse_addr(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_reuse_addr(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_reuse_addr(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1719,7 +1733,7 @@ wasi_sock_set_reuse_port(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_reuse_port(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_reuse_port(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1734,7 +1748,7 @@ wasi_sock_set_send_buf_size(wasm_exec_env_t exec_env, wasi_fd_t fd, size_t size)
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_send_buf_size(curfds, fd, size);
|
|
|
+ return wasmtime_ssp_sock_set_send_buf_size(exec_env, curfds, fd, size);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1750,7 +1764,7 @@ wasi_sock_set_send_timeout(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_send_timeout(curfds, fd, timeout_us);
|
|
|
+ return wasmtime_ssp_sock_set_send_timeout(exec_env, curfds, fd, timeout_us);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1766,7 +1780,8 @@ wasi_sock_set_tcp_fastopen_connect(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_tcp_fastopen_connect(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_tcp_fastopen_connect(exec_env, curfds, fd,
|
|
|
+ is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1782,7 +1797,7 @@ wasi_sock_set_tcp_no_delay(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_tcp_no_delay(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_tcp_no_delay(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1798,7 +1813,8 @@ wasi_sock_set_tcp_quick_ack(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_tcp_quick_ack(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_tcp_quick_ack(exec_env, curfds, fd,
|
|
|
+ is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1814,7 +1830,7 @@ wasi_sock_set_tcp_keep_idle(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_tcp_keep_idle(curfds, fd, time_s);
|
|
|
+ return wasmtime_ssp_sock_set_tcp_keep_idle(exec_env, curfds, fd, time_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1830,7 +1846,7 @@ wasi_sock_set_tcp_keep_intvl(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_tcp_keep_intvl(curfds, fd, time_s);
|
|
|
+ return wasmtime_ssp_sock_set_tcp_keep_intvl(exec_env, curfds, fd, time_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1846,7 +1862,7 @@ wasi_sock_set_ip_multicast_loop(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_ip_multicast_loop(curfds, fd, ipv6,
|
|
|
+ return wasmtime_ssp_sock_set_ip_multicast_loop(exec_env, curfds, fd, ipv6,
|
|
|
is_enabled);
|
|
|
}
|
|
|
|
|
|
@@ -1867,8 +1883,8 @@ wasi_sock_set_ip_add_membership(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_ip_add_membership(curfds, fd, imr_multiaddr,
|
|
|
- imr_interface);
|
|
|
+ return wasmtime_ssp_sock_set_ip_add_membership(
|
|
|
+ exec_env, curfds, fd, imr_multiaddr, imr_interface);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1888,8 +1904,8 @@ wasi_sock_set_ip_drop_membership(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_ip_drop_membership(curfds, fd, imr_multiaddr,
|
|
|
- imr_interface);
|
|
|
+ return wasmtime_ssp_sock_set_ip_drop_membership(
|
|
|
+ exec_env, curfds, fd, imr_multiaddr, imr_interface);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1904,7 +1920,7 @@ wasi_sock_set_ip_ttl(wasm_exec_env_t exec_env, wasi_fd_t fd, uint8_t ttl_s)
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_ip_ttl(curfds, fd, ttl_s);
|
|
|
+ return wasmtime_ssp_sock_set_ip_ttl(exec_env, curfds, fd, ttl_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1920,7 +1936,7 @@ wasi_sock_set_ip_multicast_ttl(wasm_exec_env_t exec_env, wasi_fd_t fd,
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_ip_multicast_ttl(curfds, fd, ttl_s);
|
|
|
+ return wasmtime_ssp_sock_set_ip_multicast_ttl(exec_env, curfds, fd, ttl_s);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -1935,7 +1951,7 @@ wasi_sock_set_ipv6_only(wasm_exec_env_t exec_env, wasi_fd_t fd, bool is_enabled)
|
|
|
|
|
|
curfds = wasi_ctx_get_curfds(module_inst, wasi_ctx);
|
|
|
|
|
|
- return wasmtime_ssp_sock_set_ipv6_only(curfds, fd, is_enabled);
|
|
|
+ return wasmtime_ssp_sock_set_ipv6_only(exec_env, curfds, fd, is_enabled);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|
|
|
@@ -2053,8 +2069,9 @@ wasi_sock_recv_from(wasm_exec_env_t exec_env, wasi_fd_t sock,
|
|
|
memset(buf_begin, 0, total_size);
|
|
|
|
|
|
*ro_data_len = 0;
|
|
|
- err = wasmtime_ssp_sock_recv_from(curfds, sock, buf_begin, total_size,
|
|
|
- ri_flags, src_addr, &recv_bytes);
|
|
|
+ err = wasmtime_ssp_sock_recv_from(exec_env, curfds, sock, buf_begin,
|
|
|
+ total_size, ri_flags, src_addr,
|
|
|
+ &recv_bytes);
|
|
|
if (err != __WASI_ESUCCESS) {
|
|
|
goto fail;
|
|
|
}
|
|
|
@@ -2153,7 +2170,8 @@ wasi_sock_send(wasm_exec_env_t exec_env, wasi_fd_t sock,
|
|
|
return err;
|
|
|
|
|
|
*so_data_len = 0;
|
|
|
- err = wasmtime_ssp_sock_send(curfds, sock, buf, buf_size, &send_bytes);
|
|
|
+ err = wasmtime_ssp_sock_send(exec_env, curfds, sock, buf, buf_size,
|
|
|
+ &send_bytes);
|
|
|
*so_data_len = (uint32)send_bytes;
|
|
|
|
|
|
wasm_runtime_free(buf);
|
|
|
@@ -2193,8 +2211,8 @@ wasi_sock_send_to(wasm_exec_env_t exec_env, wasi_fd_t sock,
|
|
|
return err;
|
|
|
|
|
|
*so_data_len = 0;
|
|
|
- err = wasmtime_ssp_sock_send_to(curfds, addr_pool, sock, buf, buf_size,
|
|
|
- si_flags, dest_addr, &send_bytes);
|
|
|
+ err = wasmtime_ssp_sock_send_to(exec_env, curfds, addr_pool, sock, buf,
|
|
|
+ buf_size, si_flags, dest_addr, &send_bytes);
|
|
|
*so_data_len = (uint32)send_bytes;
|
|
|
|
|
|
wasm_runtime_free(buf);
|
|
|
@@ -2212,7 +2230,7 @@ wasi_sock_shutdown(wasm_exec_env_t exec_env, wasi_fd_t sock, wasi_sdflags_t how)
|
|
|
if (!wasi_ctx)
|
|
|
return __WASI_EINVAL;
|
|
|
|
|
|
- return wasmtime_ssp_sock_shutdown(curfds, sock);
|
|
|
+ return wasmtime_ssp_sock_shutdown(exec_env, curfds, sock);
|
|
|
}
|
|
|
|
|
|
static wasi_errno_t
|