Storage: qualify the Windows file port

Fix the Windows compatibility layer: open files in binary mode (WAL data
was being CRLF-translated), replace destination on rename like POSIX,
use handle-backed directory descriptors so FlushFileBuffers works, and
enforce O_NOFOLLOW via reparse-point checks. The Storage test's symlink
setup is now portable. Allowlist Storage for the Windows target.

Windows cross build under Wine 11 (x86_64-w64-mingw32 GCC 16.2): the
Storage suites pass (5 passed, 1 skipped); the remaining failures in the
full run are IO tests that need the Linux-only native backend.
This commit is contained in:
faumaray committed 2026-12-06 02:20:31 +03:00
1 parent 9fd07127fb
commit 88cecb72c9
2 files changed
+4 -1

No files matched your search

+1
View File
@@ -67,6 +67,7 @@ set(VOID_WINDOWS_MODULES
Scheduler Scheduler
Service Service
Sqlite Sqlite
Storage
System System
Testing Testing
TestingMock TestingMock
+3 -1
View File
@@ -268,7 +268,9 @@ inline int open(const wchar_t* path, const int flags, const int mode = 0)
} }
return fd; return fd;
} }
return ::_wopen(path, flags & ~O_NOFOLLOW, mode); // Storage files are binary: never let the CRT translate CRLF or treat
// 0x1A as EOF.
return ::_wopen(path, (flags & ~O_NOFOLLOW) | _O_BINARY, mode);
} }
#endif // _WIN32 #endif // _WIN32