Skip to content

Commit f320469

Browse files
committed
track if WASIArguments is configured by user
i plan to use this to decide which wasi arguments (the one from module or the one from InstantiationArgs2) to use.
1 parent 951684c commit f320469

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

core/iwasm/common/wasm_runtime_common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,6 +3494,7 @@ wasm_runtime_set_wasi_args_ex(WASMModuleCommon *module, const char *dir_list[],
34943494
wasi_args->stdio[0] = (os_raw_file_handle)stdinfd;
34953495
wasi_args->stdio[1] = (os_raw_file_handle)stdoutfd;
34963496
wasi_args->stdio[2] = (os_raw_file_handle)stderrfd;
3497+
wasi_args->set_by_user = true;
34973498

34983499
#if WASM_ENABLE_MULTI_MODULE != 0
34993500
#if WASM_ENABLE_INTERP != 0
@@ -3524,6 +3525,7 @@ wasm_runtime_set_wasi_addr_pool(wasm_module_t module, const char *addr_pool[],
35243525
if (wasi_args) {
35253526
wasi_args->addr_pool = addr_pool;
35263527
wasi_args->addr_count = addr_pool_size;
3528+
wasi_args->set_by_user = true;
35273529
}
35283530
}
35293531

@@ -3537,6 +3539,7 @@ wasm_runtime_set_wasi_ns_lookup_pool(wasm_module_t module,
35373539
if (wasi_args) {
35383540
wasi_args->ns_lookup_pool = ns_lookup_pool;
35393541
wasi_args->ns_lookup_count = ns_lookup_pool_size;
3542+
wasi_args->set_by_user = true;
35403543
}
35413544
}
35423545

core/iwasm/interpreter/wasm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ typedef struct WASIArguments {
848848
char **argv;
849849
uint32 argc;
850850
os_raw_file_handle stdio[3];
851+
bool set_by_user;
851852
} WASIArguments;
852853
#endif
853854

0 commit comments

Comments
 (0)