IO: support populate fds into WASM application (#655)

Add new API wasm_runtime_set_wasi_args_ex to support populate stdio fds

Signed-off-by: LiFeng <lifeng68@huawei.com>
This commit is contained in:
LiFeng
2021-06-22 14:41:49 +08:00
committed by GitHub
parent 38c2ca63d0
commit c6783ef258
8 changed files with 90 additions and 20 deletions

View File

@ -630,6 +630,14 @@ wasm_exec_env_set_aux_stack(WASMExecEnv *exec_env,
#endif
#if WASM_ENABLE_LIBC_WASI != 0
WASM_RUNTIME_API_EXTERN void
wasm_runtime_set_wasi_args_ex(WASMModuleCommon *module,
const char *dir_list[], uint32 dir_count,
const char *map_dir_list[], uint32 map_dir_count,
const char *env_list[], uint32 env_count,
char *argv[], int argc,
int stdinfd, int stdoutfd, int stderrfd);
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN void
wasm_runtime_set_wasi_args(WASMModuleCommon *module,
@ -652,6 +660,7 @@ wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
const char *map_dir_list[], uint32 map_dir_count,
const char *env[], uint32 env_count,
char *argv[], uint32 argc,
int stdinfd, int stdoutfd, int stderrfd,
char *error_buf, uint32 error_buf_size);
void