Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend os_mmap to support map file from file handle #2763

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

no1wudi
Copy link
Collaborator

@no1wudi no1wudi commented Nov 14, 2023

No description provided.

@no1wudi no1wudi changed the title Extend os_mmap to support map file from file Extend os_mmap to support map file from file handle Nov 14, 2023
core/shared/platform/common/posix/posix_memmap.c Outdated Show resolved Hide resolved
core/iwasm/aot/aot_loader.c Outdated Show resolved Hide resolved
@no1wudi
Copy link
Collaborator Author

no1wudi commented Nov 15, 2023

@wenyongh What's your opinion? Should we add stub function here or promote os_get_invalid_handle() and some other basic file operation to porting layer (bh_xxx), and use them in wasi libc? Seems the actually difference between the native version and os_xx verison is the errno.

BTW, if we promote the file operation to porting layer, maybe we can unify the iwasm implementation for all platform.

core/shared/platform/riot/riot_platform.c Outdated Show resolved Hide resolved
core/shared/platform/linux-sgx/sgx_platform.c Outdated Show resolved Hide resolved
core/shared/platform/riot/riot_platform.c Outdated Show resolved Hide resolved
Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except a minor issue

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
@no1wudi
Copy link
Collaborator Author

no1wudi commented Nov 15, 2023

@zoraaver Could you review again?

Copy link
Contributor

@zoraaver zoraaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh wenyongh merged commit 24aa1cb into bytecodealliance:main Nov 16, 2023
383 checks passed
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants