Skip to content

Commit

Permalink
disk: we should use frsize as the real block size
Browse files Browse the repository at this point in the history
  • Loading branch information
darkgeek committed Sep 16, 2023
1 parent dd0253b commit 734a7a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions disk/disk_netbsd.go
Expand Up @@ -111,7 +111,7 @@ func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) {
}

_, _, err := unix.Syscall(
484, // SYS___fstatvfs190, see sys/syscall.h
484, // SYS___statvfs190, see sys/syscall.h
uintptr(unsafe.Pointer(_path)),
uintptr(unsafe.Pointer(&stat)),
uintptr(unsafe.Pointer(&flag)),
Expand All @@ -120,7 +120,8 @@ func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) {
return nil, err
}

bsize := stat.Bsize
// frsize is the real block size on NetBSD. See discuss here: https://bugzilla.samba.org/show_bug.cgi?id=11810
bsize := stat.Frsize
ret := &UsageStat{
Path: path,
Fstype: getFsType(stat),
Expand Down

0 comments on commit 734a7a6

Please sign in to comment.