Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
build with 64-bit fsblkcnt_t on 32-bit glibc platforms
It is possible to build with 64-bit file offsets on 32-bit platforms such as
armv7, and indeed this is the default for some build environments such as
Yocto. Use fsblkcnt_t, which is an alias to a type of the correct width, when
computing blockSize.
  • Loading branch information
lhoward committed Jun 28, 2025
commit 3eb8a04f9597ed71ddd3eb54db77a9d5e37f032d
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,12 @@ extension _FileManagerImpl {
let blockSize = UInt64(result.f_bsize)
#else
let fsNumber = result.f_fsid
#if canImport(Glibc)
let blockSize = fsblkcnt_t(result.f_frsize) // support 64-bit block sizes on 32-bit platforms
#else
let blockSize = UInt(result.f_frsize)
#endif
#endif
var totalSizeBytes = result.f_blocks * blockSize
var availSizeBytes = result.f_bavail * blockSize
var totalFiles = result.f_files
Expand Down