Problem
The storage and metadata layers use POSIX-only APIs (<fcntl.h>, <unistd.h>, <sys/mman.h>, pwrite, ftruncate, fsync, mmap). LogosDB does not build on Windows.
Proposal
Port the I/O layer to Windows using CreateFileMapping / MapViewOfFile (or std::filesystem + FILE* with FlushFileBuffers). Options:
- Introduce a small internal abstraction (
src/file_io.h) with open_rw, read_at, write_at, truncate, mmap_readonly, sync. Provide POSIX and Win32 implementations behind #ifdef _WIN32.
- Alternatively, wrap everything in
std::filesystem + std::fstream and accept the performance cost on Windows only.
Also:
Acceptance criteria
Problem
The storage and metadata layers use POSIX-only APIs (
<fcntl.h>,<unistd.h>,<sys/mman.h>,pwrite,ftruncate,fsync,mmap). LogosDB does not build on Windows.Proposal
Port the I/O layer to Windows using
CreateFileMapping/MapViewOfFile(orstd::filesystem+FILE*withFlushFileBuffers). Options:src/file_io.h) withopen_rw,read_at,write_at,truncate,mmap_readonly,sync. Provide POSIX and Win32 implementations behind#ifdef _WIN32.std::filesystem+std::fstreamand accept the performance cost on Windows only.Also:
windows-latestto the CI matrix (depends on Add GitHub Actions CI workflow (build + test on Linux/macOS) #1).%lluprintf formats withPRIu64where needed.Acceptance criteria
cmake --buildsucceeds with MSVC on Windows.