Merge branch main into dev/wasi-libc-windows
This commit is contained in:
@ -22,6 +22,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "wasm_export.h"
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -274,37 +276,6 @@ typedef uint8_t __wasi_sdflags_t;
|
||||
typedef uint16_t __wasi_siflags_t;
|
||||
|
||||
typedef uint8_t __wasi_signal_t;
|
||||
// 0 is reserved; POSIX has special semantics for kill(pid, 0).
|
||||
#define __WASI_SIGHUP (1)
|
||||
#define __WASI_SIGINT (2)
|
||||
#define __WASI_SIGQUIT (3)
|
||||
#define __WASI_SIGILL (4)
|
||||
#define __WASI_SIGTRAP (5)
|
||||
#define __WASI_SIGABRT (6)
|
||||
#define __WASI_SIGBUS (7)
|
||||
#define __WASI_SIGFPE (8)
|
||||
#define __WASI_SIGKILL (9)
|
||||
#define __WASI_SIGUSR1 (10)
|
||||
#define __WASI_SIGSEGV (11)
|
||||
#define __WASI_SIGUSR2 (12)
|
||||
#define __WASI_SIGPIPE (13)
|
||||
#define __WASI_SIGALRM (14)
|
||||
#define __WASI_SIGTERM (15)
|
||||
#define __WASI_SIGCHLD (16)
|
||||
#define __WASI_SIGCONT (17)
|
||||
#define __WASI_SIGSTOP (18)
|
||||
#define __WASI_SIGTSTP (19)
|
||||
#define __WASI_SIGTTIN (20)
|
||||
#define __WASI_SIGTTOU (21)
|
||||
#define __WASI_SIGURG (22)
|
||||
#define __WASI_SIGXCPU (23)
|
||||
#define __WASI_SIGXFSZ (24)
|
||||
#define __WASI_SIGVTALRM (25)
|
||||
#define __WASI_SIGPROF (26)
|
||||
#define __WASI_SIGWINCH (27)
|
||||
#define __WASI_SIGPOLL (28)
|
||||
#define __WASI_SIGPWR (29)
|
||||
#define __WASI_SIGSYS (30)
|
||||
|
||||
typedef uint16_t __wasi_subclockflags_t;
|
||||
#define __WASI_SUBSCRIPTION_CLOCK_ABSTIME (0x0001)
|
||||
@ -639,17 +610,13 @@ typedef struct __wasi_addr_info_hints_t {
|
||||
#endif
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_args_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
struct argv_environ_values *arg_environ,
|
||||
#endif
|
||||
char **argv,
|
||||
char *argv_buf
|
||||
) WASMTIME_SSP_SYSCALL_NAME(args_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_args_sizes_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
struct argv_environ_values *arg_environ,
|
||||
#endif
|
||||
size_t *argc,
|
||||
size_t *argv_buf_size
|
||||
) WASMTIME_SSP_SYSCALL_NAME(args_sizes_get) WARN_UNUSED;
|
||||
@ -666,57 +633,46 @@ __wasi_errno_t wasmtime_ssp_clock_time_get(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(clock_time_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_environ_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
struct argv_environ_values *arg_environ,
|
||||
#endif
|
||||
char **environ,
|
||||
char *environ_buf
|
||||
) WASMTIME_SSP_SYSCALL_NAME(environ_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_environ_sizes_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
struct argv_environ_values *arg_environ,
|
||||
#endif
|
||||
size_t *environ_count,
|
||||
size_t *environ_buf_size
|
||||
) WASMTIME_SSP_SYSCALL_NAME(environ_sizes_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_prestat_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
struct fd_prestats *prestats,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_prestat_t *buf
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_prestat_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_prestat_dir_name(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
struct fd_prestats *prestats,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
char *path,
|
||||
size_t path_len
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_prestat_dir_name) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_close(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
struct fd_prestats *prestats,
|
||||
#endif
|
||||
__wasi_fd_t fd
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_close) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_datasync(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_datasync) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_pread(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const __wasi_iovec_t *iovs,
|
||||
size_t iovs_len,
|
||||
@ -725,9 +681,8 @@ __wasi_errno_t wasmtime_ssp_fd_pread(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_pread) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_pwrite(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const __wasi_ciovec_t *iovs,
|
||||
size_t iovs_len,
|
||||
@ -736,9 +691,8 @@ __wasi_errno_t wasmtime_ssp_fd_pwrite(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_pwrite) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_read(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const __wasi_iovec_t *iovs,
|
||||
size_t iovs_len,
|
||||
@ -746,18 +700,16 @@ __wasi_errno_t wasmtime_ssp_fd_read(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_read) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_renumber(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
struct fd_prestats *prestats,
|
||||
#endif
|
||||
__wasi_fd_t from,
|
||||
__wasi_fd_t to
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_renumber) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_seek(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_filedelta_t offset,
|
||||
__wasi_whence_t whence,
|
||||
@ -765,49 +717,43 @@ __wasi_errno_t wasmtime_ssp_fd_seek(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_seek) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_tell(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_filesize_t *newoffset
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_tell) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_fdstat_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_fdstat_t *buf
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_fdstat_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_fdstat_set_flags(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_fdflags_t flags
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_fdstat_set_flags) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_fdstat_set_rights(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_rights_t fs_rights_base,
|
||||
__wasi_rights_t fs_rights_inheriting
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_fdstat_set_rights) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_sync(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_sync) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_write(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const __wasi_ciovec_t *iovs,
|
||||
size_t iovs_len,
|
||||
@ -815,9 +761,8 @@ __wasi_errno_t wasmtime_ssp_fd_write(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_write) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_advise(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_filesize_t offset,
|
||||
__wasi_filesize_t len,
|
||||
@ -825,28 +770,25 @@ __wasi_errno_t wasmtime_ssp_fd_advise(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_advise) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_allocate(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_filesize_t offset,
|
||||
__wasi_filesize_t len
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_allocate) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_create_directory(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const char *path,
|
||||
size_t path_len
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_create_directory) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_link(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
struct fd_prestats *prestats,
|
||||
#endif
|
||||
__wasi_fd_t old_fd,
|
||||
__wasi_lookupflags_t old_flags,
|
||||
const char *old_path,
|
||||
@ -857,9 +799,8 @@ __wasi_errno_t wasmtime_ssp_path_link(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_link) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_open(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t dirfd,
|
||||
__wasi_lookupflags_t dirflags,
|
||||
const char *path,
|
||||
@ -872,9 +813,8 @@ __wasi_errno_t wasmtime_ssp_path_open(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_open) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_readdir(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
void *buf,
|
||||
size_t buf_len,
|
||||
@ -883,9 +823,8 @@ __wasi_errno_t wasmtime_ssp_fd_readdir(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_readdir) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_readlink(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const char *path,
|
||||
size_t path_len,
|
||||
@ -895,9 +834,8 @@ __wasi_errno_t wasmtime_ssp_path_readlink(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_readlink) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_rename(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t old_fd,
|
||||
const char *old_path,
|
||||
size_t old_path_len,
|
||||
@ -907,17 +845,15 @@ __wasi_errno_t wasmtime_ssp_path_rename(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_rename) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_filestat_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_filestat_t *buf
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_filestat_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_filestat_set_times(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_timestamp_t st_atim,
|
||||
__wasi_timestamp_t st_mtim,
|
||||
@ -925,17 +861,15 @@ __wasi_errno_t wasmtime_ssp_fd_filestat_set_times(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_filestat_set_times) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_fd_filestat_set_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_filesize_t st_size
|
||||
) WASMTIME_SSP_SYSCALL_NAME(fd_filestat_set_size) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_filestat_get(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_lookupflags_t flags,
|
||||
const char *path,
|
||||
@ -944,9 +878,8 @@ __wasi_errno_t wasmtime_ssp_path_filestat_get(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_filestat_get) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_filestat_set_times(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
__wasi_lookupflags_t flags,
|
||||
const char *path,
|
||||
@ -957,10 +890,9 @@ __wasi_errno_t wasmtime_ssp_path_filestat_set_times(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_filestat_set_times) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_symlink(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
struct fd_prestats *prestats,
|
||||
#endif
|
||||
const char *old_path,
|
||||
size_t old_path_len,
|
||||
__wasi_fd_t fd,
|
||||
@ -969,47 +901,30 @@ __wasi_errno_t wasmtime_ssp_path_symlink(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_symlink) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_unlink_file(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const char *path,
|
||||
size_t path_len
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_unlink_file) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_path_remove_directory(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd,
|
||||
const char *path,
|
||||
size_t path_len
|
||||
) WASMTIME_SSP_SYSCALL_NAME(path_remove_directory) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_poll_oneoff(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
const __wasi_subscription_t *in,
|
||||
__wasi_event_t *out,
|
||||
size_t nsubscriptions,
|
||||
size_t *nevents
|
||||
) WASMTIME_SSP_SYSCALL_NAME(poll_oneoff) WARN_UNUSED;
|
||||
|
||||
#if 0
|
||||
/**
|
||||
* We throw exception in libc-wasi wrapper function wasi_proc_exit()
|
||||
* but not call this function.
|
||||
*/
|
||||
_Noreturn void wasmtime_ssp_proc_exit(
|
||||
__wasi_exitcode_t rval
|
||||
) WASMTIME_SSP_SYSCALL_NAME(proc_exit);
|
||||
#endif
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_proc_raise(
|
||||
__wasi_signal_t sig
|
||||
) WASMTIME_SSP_SYSCALL_NAME(proc_raise) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_random_get(
|
||||
void *buf,
|
||||
size_t buf_len
|
||||
@ -1017,50 +932,44 @@ __wasi_errno_t wasmtime_ssp_random_get(
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_accept(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_fdflags_t flags, __wasi_fd_t *fd_new
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_addr_local(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_addr_t *addr
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_addr_remote(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_addr_t *addr
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_open(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t poolfd, __wasi_address_family_t af, __wasi_sock_type_t socktype,
|
||||
__wasi_fd_t *sockfd
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_bind(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds, struct addr_pool *addr_pool,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_addr_t *addr
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_addr_resolve(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds, char **ns_lookup_list,
|
||||
#endif
|
||||
const char *host, const char* service,
|
||||
__wasi_addr_info_hints_t *hints, __wasi_addr_info_t *addr_info,
|
||||
__wasi_size_t addr_info_size, __wasi_size_t *max_info_size
|
||||
@ -1068,88 +977,77 @@ wasi_ssp_sock_addr_resolve(
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_connect(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds, struct addr_pool *addr_pool,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_addr_t *addr
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_get_recv_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_size_t *size
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_get_reuse_addr(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, uint8_t *reuse
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_get_reuse_port(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, uint8_t *reuse
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_get_send_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_size_t *size
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_set_recv_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_size_t size
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_set_reuse_addr(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, uint8_t reuse
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_set_reuse_port(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, uint8_t reuse
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_set_send_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_size_t size
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t
|
||||
wasi_ssp_sock_listen(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t fd, __wasi_size_t backlog
|
||||
) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_recv(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
void *buf,
|
||||
size_t buf_len,
|
||||
@ -1157,9 +1055,8 @@ __wasi_errno_t wasmtime_ssp_sock_recv(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_recv) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_recv_from(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
void *buf,
|
||||
size_t buf_len,
|
||||
@ -1169,9 +1066,8 @@ __wasi_errno_t wasmtime_ssp_sock_recv_from(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_recv_from) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_send(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
const void *buf,
|
||||
size_t buf_len,
|
||||
@ -1179,9 +1075,8 @@ __wasi_errno_t wasmtime_ssp_sock_send(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_send) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_send_to(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds, struct addr_pool *addr_pool,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
const void *buf,
|
||||
size_t buf_len,
|
||||
@ -1191,317 +1086,278 @@ __wasi_errno_t wasmtime_ssp_sock_send_to(
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_send_to) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_shutdown(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_shutdown) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_recv_timeout(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint64_t timeout_us
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_recv_timeout) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_recv_timeout(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint64_t *timeout_us
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_recv_timeout) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_send_timeout(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint64_t timeout_us
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_send_timeout) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_send_timeout(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint64_t *timeout_us
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_send_timeout) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_send_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
size_t bufsiz
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_send_buf_size) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_send_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
size_t *bufsiz
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_send_buf_size) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_recv_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
size_t bufsiz
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_recv_buf_size) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_recv_buf_size(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
size_t *bufsiz
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_recv_buf_size) WARN_UNUSED;
|
||||
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_keep_alive(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_keep_alive) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_keep_alive(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_keep_alive) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_reuse_addr(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_reuse_addr) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_reuse_addr(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_reuse_addr) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_reuse_port(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_reuse_port) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_reuse_port(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_reuse_port) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_linger(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled,
|
||||
int linger_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_linger) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_linger(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock, bool *is_enabled, int *linger_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_linger) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_broadcast(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_broadcast) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_broadcast(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_broadcast) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_tcp_no_delay(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_tcp_no_delay) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_tcp_no_delay(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_tcp_no_delay) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_tcp_quick_ack(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_tcp_quick_ack) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_tcp_quick_ack(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_tcp_quick_ack) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_tcp_keep_idle(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint32_t time_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_tcp_keep_idle) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_tcp_keep_idle(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint32_t *time_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_tcp_keep_idle) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_tcp_keep_intvl(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint32_t time_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_tcp_keep_intvl) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_tcp_keep_intvl(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint32_t *time_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_tcp_keep_intvl) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_tcp_fastopen_connect(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_tcp_fastopen_connect) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_tcp_fastopen_connect(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_tcp_fastopen_connect) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_ip_multicast_loop(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool ipv6,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_ip_multicast_loop) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_ip_multicast_loop(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool ipv6,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_ip_multicast_loop) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_ip_add_membership(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
__wasi_addr_ip_t *imr_multiaddr,
|
||||
uint32_t imr_interface
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_ip_add_membership) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_ip_drop_membership(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
__wasi_addr_ip_t *imr_multiaddr,
|
||||
uint32_t imr_interface
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_ip_drop_membership) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_ip_ttl(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint8_t ttl_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_ip_ttl) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_ip_ttl(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint8_t *ttl_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_ip_ttl) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_ip_multicast_ttl(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint8_t ttl_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_ip_multicast_ttl) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_ip_multicast_ttl(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
uint8_t *ttl_s
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_ip_multicast_ttl) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_set_ipv6_only(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_set_ipv6_only) WARN_UNUSED;
|
||||
|
||||
__wasi_errno_t wasmtime_ssp_sock_get_ipv6_only(
|
||||
#if !defined(WASMTIME_SSP_STATIC_CURFDS)
|
||||
wasm_exec_env_t exec_env,
|
||||
struct fd_table *curfds,
|
||||
#endif
|
||||
__wasi_fd_t sock,
|
||||
bool *is_enabled
|
||||
) WASMTIME_SSP_SYSCALL_NAME(sock_get_ipv6_only) WARN_UNUSED;
|
||||
|
||||
@ -0,0 +1,226 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Midokura Japan KK. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "ssp_config.h"
|
||||
#include "blocking_op.h"
|
||||
|
||||
int
|
||||
blocking_op_close(wasm_exec_env_t exec_env, int fd)
|
||||
{
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
int ret = close(fd);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
blocking_op_readv(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt)
|
||||
{
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
#else
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
ssize_t ret = readv(fd, iov, iovcnt);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CONFIG_HAS_PREADV
|
||||
ssize_t
|
||||
blocking_op_preadv(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt, off_t offset)
|
||||
{
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
ssize_t ret = preadv(fd, iov, iovcnt, offset);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
#else /* CONFIG_HAS_PREADV */
|
||||
ssize_t
|
||||
blocking_op_pread(wasm_exec_env_t exec_env, int fd, void *p, size_t nb,
|
||||
off_t offset)
|
||||
{
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
#else
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
ssize_t ret = pread(fd, p, nb, offset);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_HAS_PREADV */
|
||||
|
||||
ssize_t
|
||||
blocking_op_writev(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt)
|
||||
{
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
#else
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
ssize_t ret = writev(fd, iov, iovcnt);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CONFIG_HAS_PWRITEV
|
||||
ssize_t
|
||||
blocking_op_pwritev(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt, off_t offset)
|
||||
{
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
ssize_t ret = pwritev(fd, iov, iovcnt, offset);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
#else /* CONFIG_HAS_PWRITEV */
|
||||
ssize_t
|
||||
blocking_op_pwrite(wasm_exec_env_t exec_env, int fd, const void *p, size_t nb,
|
||||
off_t offset)
|
||||
{
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
#else
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
ssize_t ret = pwrite(fd, p, nb, offset);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_HAS_PWRITEV */
|
||||
|
||||
int
|
||||
blocking_op_socket_accept(wasm_exec_env_t exec_env, bh_socket_t server_sock,
|
||||
bh_socket_t *sockp, void *addr,
|
||||
unsigned int *addrlenp)
|
||||
{
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
int ret = os_socket_accept(server_sock, sockp, addr, addrlenp);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
blocking_op_socket_connect(wasm_exec_env_t exec_env, bh_socket_t sock,
|
||||
const char *addr, int port)
|
||||
{
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
int ret = os_socket_connect(sock, addr, port);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
blocking_op_socket_recv_from(wasm_exec_env_t exec_env, bh_socket_t sock,
|
||||
void *buf, unsigned int len, int flags,
|
||||
bh_sockaddr_t *src_addr)
|
||||
{
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
int ret = os_socket_recv_from(sock, buf, len, flags, src_addr);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
blocking_op_socket_send_to(wasm_exec_env_t exec_env, bh_socket_t sock,
|
||||
const void *buf, unsigned int len, int flags,
|
||||
const bh_sockaddr_t *dest_addr)
|
||||
{
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
int ret = os_socket_send_to(sock, buf, len, flags, dest_addr);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
blocking_op_socket_addr_resolve(wasm_exec_env_t exec_env, const char *host,
|
||||
const char *service, uint8_t *hint_is_tcp,
|
||||
uint8_t *hint_is_ipv4,
|
||||
bh_addr_info_t *addr_info,
|
||||
size_t addr_info_size, size_t *max_info_size)
|
||||
{
|
||||
/*
|
||||
* Note: Unlike others, os_socket_addr_resolve() is not a simple system
|
||||
* call. It's likely backed by a complex libc function, getaddrinfo().
|
||||
* Depending on the implementation of getaddrinfo() and underlying
|
||||
* DNS resolver, it might or might not be possible to make it return
|
||||
* with os_wakeup_blocking_op().
|
||||
*
|
||||
* Unfortunately, many of ISC/bind based resolvers just keep going on
|
||||
* interrupted system calls. It includes macOS and glibc.
|
||||
*
|
||||
* On the other hand, NuttX as of writing this returns EAI_AGAIN
|
||||
* on EINTR.
|
||||
*/
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
int ret = os_socket_addr_resolve(host, service, hint_is_tcp, hint_is_ipv4,
|
||||
addr_info, addr_info_size, max_info_size);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
blocking_op_openat(wasm_exec_env_t exec_env, int fd, const char *path,
|
||||
int oflags, mode_t mode)
|
||||
{
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
#else
|
||||
if (!wasm_runtime_begin_blocking_op(exec_env)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
}
|
||||
int ret = openat(fd, path, oflags, mode);
|
||||
wasm_runtime_end_blocking_op(exec_env);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Midokura Japan KK. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#include "bh_platform.h"
|
||||
#include "wasm_export.h"
|
||||
|
||||
int
|
||||
blocking_op_close(wasm_exec_env_t exec_env, int fd);
|
||||
ssize_t
|
||||
blocking_op_readv(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt);
|
||||
ssize_t
|
||||
blocking_op_preadv(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt, off_t offset);
|
||||
ssize_t
|
||||
blocking_op_pread(wasm_exec_env_t exec_env, int fd, void *p, size_t nb,
|
||||
off_t offset);
|
||||
ssize_t
|
||||
blocking_op_writev(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt);
|
||||
ssize_t
|
||||
blocking_op_pwritev(wasm_exec_env_t exec_env, int fd, const struct iovec *iov,
|
||||
int iovcnt, off_t offset);
|
||||
ssize_t
|
||||
blocking_op_pwrite(wasm_exec_env_t exec_env, int fd, const void *p, size_t nb,
|
||||
off_t offset);
|
||||
int
|
||||
blocking_op_socket_accept(wasm_exec_env_t exec_env, bh_socket_t server_sock,
|
||||
bh_socket_t *sockp, void *addr,
|
||||
unsigned int *addrlenp);
|
||||
int
|
||||
blocking_op_socket_connect(wasm_exec_env_t exec_env, bh_socket_t sock,
|
||||
const char *addr, int port);
|
||||
int
|
||||
blocking_op_socket_recv_from(wasm_exec_env_t exec_env, bh_socket_t sock,
|
||||
void *buf, unsigned int len, int flags,
|
||||
bh_sockaddr_t *src_addr);
|
||||
int
|
||||
blocking_op_socket_send_to(wasm_exec_env_t exec_env, bh_socket_t sock,
|
||||
const void *buf, unsigned int len, int flags,
|
||||
const bh_sockaddr_t *dest_addr);
|
||||
int
|
||||
blocking_op_socket_addr_resolve(wasm_exec_env_t exec_env, const char *host,
|
||||
const char *service, uint8_t *hint_is_tcp,
|
||||
uint8_t *hint_is_ipv4,
|
||||
bh_addr_info_t *addr_info,
|
||||
size_t addr_info_size, size_t *max_info_size);
|
||||
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
/* TODO to be (re)moved as part of WASI on windows work */
|
||||
typedef unsigned mode_t;
|
||||
#endif
|
||||
int
|
||||
blocking_op_openat(wasm_exec_env_t exec_env, int fd, const char *path,
|
||||
int oflags, mode_t mode);
|
||||
File diff suppressed because it is too large
Load Diff
@ -14,8 +14,8 @@
|
||||
#ifndef SSP_CONFIG_H
|
||||
#define SSP_CONFIG_H
|
||||
|
||||
#include "bh_platform.h"
|
||||
#include "gnuc.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__APPLE__) \
|
||||
|| (defined(ANDROID) && __ANDROID_API__ < 28)
|
||||
@ -66,7 +66,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(ESP_PLATFORM) && !defined(_WIN32)
|
||||
#if !defined(__APPLE__) && !defined(ESP_PLATFORM) && !defined(_WIN32) \
|
||||
&& !defined(__COSMOPOLITAN__)
|
||||
#define CONFIG_HAS_POSIX_FALLOCATE 1
|
||||
#else
|
||||
#define CONFIG_HAS_POSIX_FALLOCATE 0
|
||||
@ -84,7 +85,8 @@
|
||||
#define CONFIG_HAS_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(BH_PLATFORM_LINUX_SGX) && !defined(_WIN32)
|
||||
#if !defined(__APPLE__) && !defined(BH_PLATFORM_LINUX_SGX) && !defined(_WIN32) \
|
||||
&& !defined(__COSMOPOLITAN__)
|
||||
#define CONFIG_HAS_PTHREAD_CONDATTR_SETCLOCK 1
|
||||
#else
|
||||
#define CONFIG_HAS_PTHREAD_CONDATTR_SETCLOCK 0
|
||||
@ -102,10 +104,18 @@
|
||||
#define st_mtim st_mtimespec
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define CONFIG_TLS_USE_GSBASE 1
|
||||
#else
|
||||
#define CONFIG_TLS_USE_GSBASE 0
|
||||
#if defined(O_DSYNC)
|
||||
#define CONFIG_HAS_O_DSYNC
|
||||
#endif
|
||||
|
||||
// POSIX requires O_RSYNC to be defined, but Linux explicitly doesn't support
|
||||
// it.
|
||||
#if defined(O_RSYNC) && !defined(__linux__)
|
||||
#define CONFIG_HAS_O_RSYNC
|
||||
#endif
|
||||
|
||||
#if defined(O_SYNC)
|
||||
#define CONFIG_HAS_O_SYNC
|
||||
#endif
|
||||
|
||||
#if !defined(BH_PLATFORM_LINUX_SGX)
|
||||
|
||||
Reference in New Issue
Block a user