unix,win: add f_frsize field to uv_statfs_t

Fixes: https://github.com/libuv/libuv/issues/4983
This commit is contained in:
Ben Noordhuis 2026-01-01 20:51:50 +01:00
parent 3e9ae1bca0
commit 31668dc762
5 changed files with 7 additions and 2 deletions

View File

@ -129,7 +129,8 @@ Data types
uint64_t f_bavail;
uint64_t f_files;
uint64_t f_ffree;
uint64_t f_spare[4];
uint64_t f_frsize;
uint64_t f_spare[3];
} uv_statfs_t;
.. c:enum:: uv_dirent_type_t

View File

@ -1262,7 +1262,8 @@ struct uv_statfs_s {
uint64_t f_bavail;
uint64_t f_files;
uint64_t f_ffree;
uint64_t f_spare[4];
uint64_t f_frsize;
uint64_t f_spare[3];
};
typedef enum {

View File

@ -706,6 +706,7 @@ static int uv__fs_statfs(uv_fs_t* req) {
stat_fs->f_type = buf.f_type;
#endif
stat_fs->f_bsize = buf.f_bsize;
stat_fs->f_frsize = buf.f_frsize;
stat_fs->f_blocks = buf.f_blocks;
stat_fs->f_bfree = buf.f_bfree;
stat_fs->f_bavail = buf.f_bavail;

View File

@ -3154,6 +3154,7 @@ retry_get_full_path_name:
stat_fs->f_type = 0;
stat_fs->f_bsize = bytes_per_sector * sectors_per_cluster;
stat_fs->f_frsize = bytes_per_sector * sectors_per_cluster;
stat_fs->f_blocks = total_clusters;
stat_fs->f_bfree = free_clusters;
stat_fs->f_bavail = free_clusters;

View File

@ -363,6 +363,7 @@ static void statfs_cb(uv_fs_t* req) {
#endif
ASSERT_GT(stats->f_bsize, 0);
ASSERT_GT(stats->f_frsize, 0);
ASSERT_GT(stats->f_blocks, 0);
ASSERT_LE(stats->f_bfree, stats->f_blocks);
ASSERT_LE(stats->f_bavail, stats->f_bfree);