LibCore: Port MappedFile to Windows
Some checks failed
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled

This commit is contained in:
stasoid 2024-11-16 11:55:19 +05:00 committed by Jelle Raaijmakers
parent 153dc6686c
commit b3464d0645
Notes: github-actions[bot] 2024-11-26 09:01:09 +00:00
2 changed files with 5 additions and 3 deletions

View file

@ -114,3 +114,7 @@ endif()
if (ANDROID)
target_link_libraries(LibCore PRIVATE log)
endif()
if (WIN32)
target_include_directories(LibCore PRIVATE ${MMAN_INCLUDE_DIR})
endif()

View file

@ -9,9 +9,7 @@
#include <LibCore/File.h>
#include <LibCore/MappedFile.h>
#include <LibCore/System.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
namespace Core {
@ -30,7 +28,7 @@ ErrorOr<NonnullOwnPtr<MappedFile>> MappedFile::map_from_file(NonnullOwnPtr<Core:
ErrorOr<NonnullOwnPtr<MappedFile>> MappedFile::map_from_fd_and_close(int fd, [[maybe_unused]] StringView path, Mode mode)
{
ScopeGuard fd_close_guard = [fd] {
::close(fd);
(void)System::close(fd);
};
auto stat = TRY(Core::System::fstat(fd));