Extend os_mmap to support map file from fd (#2763)
Add an extra argument `os_file_handle file` for `os_mmap` to support mapping file from a file fd, and remove `os_get_invalid_handle` from `posix_file.c` and `win_file.c`, instead, add it in the `platform_internal.h` files to remove the dependency on libc-wasi. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
@ -58,7 +58,8 @@ wasm_exec_env_create_internal(struct WASMModuleInstanceCommon *module_inst,
|
||||
|
||||
#ifdef OS_ENABLE_HW_BOUND_CHECK
|
||||
if (!(exec_env->exce_check_guard_page =
|
||||
os_mmap(NULL, os_getpagesize(), MMAP_PROT_NONE, MMAP_MAP_NONE)))
|
||||
os_mmap(NULL, os_getpagesize(), MMAP_PROT_NONE, MMAP_MAP_NONE,
|
||||
os_get_invalid_handle())))
|
||||
goto fail5;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user