Unverified Commit 8243bab5 authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #663 from secumod/non-4k-page-size

Fix filesystem-disk-test to support platforms with non-4K filesystem block size
parents 9694c373 a01f80ea
......@@ -897,7 +897,14 @@ KJ_TEST("DiskFile holes") {
#endif
// Try punching a hole with zero().
file->zero(1 << 20, 4096);
#if _WIN32
uint64_t blockSize = 4096; // TODO(someday): Actually ask the OS.
#else
struct stat stats;
KJ_SYSCALL(fstat(KJ_ASSERT_NONNULL(file->getFd()), &stats));
uint64_t blockSize = stats.st_blksize;
#endif
file->zero(1 << 20, blockSize);
file->datasync();
#if !_WIN32
// TODO(someday): This doesn't work on Windows. I don't know why. We're definitely using the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment