aboutsummaryrefslogtreecommitdiff
path: root/zenstore/basicfile.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-01 15:39:49 +0200
committerDan Engelbrecht <[email protected]>2022-04-01 15:39:49 +0200
commit98c7fd153f4d25f13b8e4bc81648b02f80698c93 (patch)
tree3a6ce7256abe702b3a0130b37d61324bdb48edc1 /zenstore/basicfile.cpp
parentfix BasicFile::Open on Linux (diff)
downloadzen-98c7fd153f4d25f13b8e4bc81648b02f80698c93.tar.xz
zen-98c7fd153f4d25f13b8e4bc81648b02f80698c93.zip
make sure we allocate disk space when we set file size
Diffstat (limited to 'zenstore/basicfile.cpp')
-rw-r--r--zenstore/basicfile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp
index 042f0aa43..93d4ded13 100644
--- a/zenstore/basicfile.cpp
+++ b/zenstore/basicfile.cpp
@@ -329,9 +329,11 @@ BasicFile::SetFileSize(uint64_t FileSize)
#elif ZEN_PLATFORM_MAC
int Fd = int(intptr_t(m_FileHandle));
ftruncate(Fd, (off_t)FileSize);
+ posix_fallocate(Fd, 0, (off_t)FileSize);
#else
- int Fd = int(intptr_t(m_FileHandle));
+ posix_fallocate(Fd, 0, ) int Fd = int(intptr_t(m_FileHandle));
ftruncate64(Fd, (off64_t)FileSize);
+ posix_fallocate64(Fd, 0, (off64_t)FileSize);
#endif
}