Fix cross-platform compilation for all target platforms

- Fixed type mismatch in disk space calculation (int64 casting)
- Created platform-specific disk space implementations:
  * diskspace_unix.go (Linux, macOS, FreeBSD)
  * diskspace_windows.go (Windows)
  * diskspace_bsd.go (OpenBSD)
  * diskspace_netbsd.go (NetBSD fallback)
- All 10 platforms now compile successfully:
   Linux (amd64, arm64, armv7)
   macOS (Intel, Apple Silicon)
   Windows (amd64, arm64)
   FreeBSD, OpenBSD, NetBSD
This commit is contained in:
2025-11-07 15:16:54 +00:00
parent 2d34eca514
commit 9d1d276d39
16 changed files with 82 additions and 7 deletions

View File

@ -0,0 +1,11 @@
// +build netbsd
package restore
// getDiskSpace returns available disk space in bytes (NetBSD fallback)
// NetBSD has different syscall interface, so we use a conservative estimate
func getDiskSpace(path string) (int64, error) {
// Return a large value to skip disk space check on NetBSD
// This is a fallback - restore will still work, just won't pre-check space
return 1 << 40, nil // 1 TB
}