Abstract POSIX filesystem functions (#2585)
To allow non-POSIX platforms such as Windows to support WASI libc filesystem functionality, create a set of wrapper functions which provide a platform-agnostic interface to interact with the host filesystem. For now, the Windows implementation is stubbed but this will be implemented properly in a future PR. There are no functional changes in this change, just a reorganization of code to move any direct POSIX references out of posix.c in the libc implementation into posix_file.c under the shared POSIX sources. See https://github.com/bytecodealliance/wasm-micro-runtime/issues/2495 for a more detailed overview of the plan to port the WASI libc filesystem to Windows.
This commit is contained in:
@ -5,4 +5,11 @@ set (PLATFORM_COMMON_POSIX_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
file (GLOB_RECURSE source_all ${PLATFORM_COMMON_POSIX_DIR}/*.c)
|
||||
|
||||
if (NOT WAMR_BUILD_LIBC_WASI EQUAL 1)
|
||||
list(REMOVE_ITEM source_all ${PLATFORM_COMMON_POSIX_DIR}/posix_file.c)
|
||||
else()
|
||||
include (${CMAKE_CURRENT_LIST_DIR}/../libc-util/platform_common_libc_util.cmake)
|
||||
set(source_all ${source_all} ${PLATFORM_COMMON_LIBC_UTIL_SOURCE})
|
||||
endif()
|
||||
|
||||
set (PLATFORM_COMMON_POSIX_SOURCE ${source_all} )
|
||||
|
||||
1013
core/shared/platform/common/posix/posix_file.c
Normal file
1013
core/shared/platform/common/posix/posix_file.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user