wamr_sys

Function wasm_runtime_set_wasi_args_ex

Source
pub unsafe extern "C" fn wasm_runtime_set_wasi_args_ex(
    module: wasm_module_t,
    dir_list: *mut *const c_char,
    dir_count: u32,
    map_dir_list: *mut *const c_char,
    map_dir_count: u32,
    env: *mut *const c_char,
    env_count: u32,
    argv: *mut *mut c_char,
    argc: c_int,
    stdinfd: i64,
    stdoutfd: i64,
    stderrfd: i64,
)
Expand description

Set WASI parameters.

While this API operates on a module, these parameters will be used only when the module is instantiated. That is, you can consider these as extra parameters for wasm_runtime_instantiate().

@param module The module to set WASI parameters. @param dir_list The list of directories to preopen. (real path) @param dir_count The number of elements in dir_list. @param map_dir_list The list of directories to preopen. (mapped path) Format for each map entry: :: @param map_dir_count The number of elements in map_dir_list. If map_dir_count is smaller than dir_count, mapped path is assumed to be same as the corresponding real path for the rest of entries. @param env The list of environment variables. @param env_count The number of elements in env. @param argv The list of command line arguments. @param argc The number of elements in argv. @param stdin_handle The raw host handle to back WASI STDIN_FILENO. If an invalid handle is specified (e.g. -1 on POSIX, INVALID_HANDLE_VALUE on Windows), the platform default for STDIN is used. @param stdoutfd The raw host handle to back WASI STDOUT_FILENO. If an invalid handle is specified (e.g. -1 on POSIX, INVALID_HANDLE_VALUE on Windows), the platform default for STDOUT is used. @param stderrfd The raw host handle to back WASI STDERR_FILENO. If an invalid handle is specified (e.g. -1 on POSIX, INVALID_HANDLE_VALUE on Windows), the platform default for STDERR is used.