summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/r3/fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Runtime/r3/fs.cpp')
-rw-r--r--src/VBox/Runtime/r3/fs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/VBox/Runtime/r3/fs.cpp b/src/VBox/Runtime/r3/fs.cpp
index 74a9d64f1..b22b6fe99 100644
--- a/src/VBox/Runtime/r3/fs.cpp
+++ b/src/VBox/Runtime/r3/fs.cpp
@@ -35,6 +35,7 @@
#ifndef RT_OS_WINDOWS
# define RTTIME_INCL_TIMESPEC
# include <sys/time.h>
+# include <sys/param.h>
#endif
#include <iprt/fs.h>
@@ -195,7 +196,7 @@ bool rtFsModeIsValidPermissions(RTFMODE fMode)
void rtFsConvertStatToObjInfo(PRTFSOBJINFO pObjInfo, const struct stat *pStat, const char *pszName, unsigned cbName)
{
pObjInfo->cbObject = pStat->st_size;
- pObjInfo->cbAllocated = pStat->st_size;
+ pObjInfo->cbAllocated = pStat->st_blocks * DEV_BSIZE;
#ifdef HAVE_STAT_NSEC
RTTimeSpecAddNano(RTTimeSpecSetSeconds(&pObjInfo->AccessTime, pStat->st_atime), pStat->st_atimensec);