mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: update buildkit to v0.19.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
21
vendor/github.com/moby/buildkit/util/disk/disk_netbsd.go
generated
vendored
Normal file
21
vendor/github.com/moby/buildkit/util/disk/disk_netbsd.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
//go:build netbsd
|
||||
|
||||
package disk
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func GetDiskStat(root string) (DiskStat, error) {
|
||||
var st unix.Statvfs_t
|
||||
if err := unix.Statvfs(root, &st); err != nil {
|
||||
return DiskStat{}, errors.Wrapf(err, "could not stat fs at %s", root)
|
||||
}
|
||||
|
||||
return DiskStat{
|
||||
Total: int64(st.Frsize) * int64(st.Blocks),
|
||||
Free: int64(st.Frsize) * int64(st.Bfree),
|
||||
Available: int64(st.Frsize) * int64(st.Bavail),
|
||||
}, nil
|
||||
}
|
Reference in New Issue
Block a user