Files
dbbackup/internal/restore/diskspace_bsd.go
A. Renz 914307ac8f ci: add golangci-lint config and fix formatting
- Add .golangci.yml with minimal linters (govet, ineffassign)
- Run gofmt -s and goimports on all files to fix formatting
- Disable fieldalignment and copylocks checks in govet
2025-12-11 17:53:28 +01:00

17 lines
388 B
Go
Executable File

//go:build openbsd
// +build openbsd
package restore
import "syscall"
// getDiskSpace returns available disk space in bytes (OpenBSD)
func getDiskSpace(path string) (int64, error) {
var statfs syscall.Statfs_t
if err := syscall.Statfs(path, &statfs); err != nil {
return 0, err
}
// OpenBSD uses F_bavail and F_bsize
return int64(statfs.F_bavail) * int64(statfs.F_bsize), nil
}