From 238fc0799e2cbf69560095360ac74eefd0d40fdb Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Sat, 24 Sep 2022 05:23:28 +0000 Subject: [PATCH] Fixed statfs(free inodes) for macos --- src/s3fs.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/s3fs.cpp b/src/s3fs.cpp index f179481..842a8fc 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -2450,11 +2450,16 @@ static int s3fs_statfs(const char* _path, struct statvfs* stbuf) // WTF8_ENCODE(path) stbuf->f_bsize = 16 * 1024 * 1024; stbuf->f_namemax = NAME_MAX; -#ifdef __MSYS__ +#if defined(__MSYS__) // WinFsp resolves the free space from f_bfree * f_frsize, and the total space from f_blocks * f_frsize (in bytes). stbuf->f_frsize = stbuf->f_bsize; stbuf->f_blocks = INT32_MAX; stbuf->f_bfree = INT32_MAX; +#elif defined(__APPLE__) + stbuf->f_blocks = UINT32_MAX; + stbuf->f_bfree = UINT32_MAX; + stbuf->f_files = UINT32_MAX; + stbuf->f_ffree = UINT32_MAX; #else stbuf->f_blocks = static_cast(~0) / stbuf->f_bsize; stbuf->f_bfree = stbuf->f_blocks;