Skip to content

Commit 0836cbe

Browse files
committed
Replace ftruncate with fallocate
1 parent 0a23784 commit 0836cbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/memory/map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ bool map::remap_(size_t size) NOEXCEPT
558558
bool map::resize_(size_t size) NOEXCEPT
559559
{
560560
// Disk full detection is platform common, any other failure is an abort.
561-
if (::ftruncate(opened_, size) == fail)
561+
if (::fallocate(opened_, 0, capacity_, size - capacity_) == fail)
562562
{
563563
// Disk full is the only restartable store failure (leave mapped).
564564
if (errno == ENOSPC)

0 commit comments

Comments
 (0)