Use f_namemax if available in statfs(2).

This commit is contained in:
2021-03-15 02:52:56 +00:00
parent 1e0b0109f0
commit 5eba1d374b
2 changed files with 12 additions and 3 deletions

View File

@@ -151,8 +151,10 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
log_write("\tVolume size: %llu bytes\n", ((unsigned long long)buf.f_blocks) * buf.f_bsize);
log_write("\tVolume free: %llu bytes\n", ((unsigned long long)buf.f_bfree) * buf.f_bsize);
#if defined(USE_STATFS_FNAMELEN)
#ifdef USE_STATFS_FNAMELEN
log_write("\tMaximum component length: %ld\n", buf.f_namelen);
#elif USE_STATFS_NAMEMAX
log_write("\tMaximum component length: %ld\n", buf.f_namemax);
#endif
if(buf.f_flags)