ceremonyclient/node/utils/selftest_intrinsics_unix.go

18 lines
260 B
Go
Raw Normal View History

2024-03-01 07:12:31 +00:00
//go:build !windows
// +build !windows
package utils
import "golang.org/x/sys/unix"
func GetDiskSpace(dir string) uint64 {
var stat unix.Statfs_t
err := unix.Statfs(dir, &stat)
if err != nil {
panic(err)
}
return stat.Bavail * uint64(stat.Bsize)
}