Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage OpenBSD/adJ #2809

Merged
merged 15 commits into from
Jul 29, 2024
Merged
2 changes: 1 addition & 1 deletion tests/fixture/tmpnet/detached_process_default.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

//go:build linux || darwin
//go:build linux || darwin || unix

package tmpnet

Expand Down
18 changes: 18 additions & 0 deletions utils/storage/storage_openbsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Public Domain
StephenButtolph marked this conversation as resolved.
Show resolved Hide resolved

//go:build openbsd
// +build openbsd

package storage

import "syscall"

func AvailableBytes(storagePath string) (uint64, error) {
var stat syscall.Statfs_t
err := syscall.Statfs(storagePath, &stat)
if err != nil {
return 0, err
}
avail := uint64(stat.F_bavail) * uint64(stat.F_bsize)
return avail, nil
}
4 changes: 2 additions & 2 deletions utils/storage/storage_unix.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

//go:build !windows
// +build !windows
//go:build !windows && !openbsd
// +build !windows,!openbsd

package storage

Expand Down
Loading