mirror of
https://github.com/amir20/dozzle.git
synced 2026-08-07 11:24:44 +00:00
3895d87337
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 lines
371 B
Go
16 lines
371 B
Go
//go:build !windows
|
|
|
|
package container
|
|
|
|
import "syscall"
|
|
|
|
// statfs returns (total, free) bytes for the filesystem hosting path.
|
|
func statfs(path string) (total uint64, free uint64, err error) {
|
|
var st syscall.Statfs_t
|
|
if err = syscall.Statfs(path, &st); err != nil {
|
|
return 0, 0, err
|
|
}
|
|
bsize := uint64(st.Bsize)
|
|
return st.Blocks * bsize, st.Bavail * bsize, nil
|
|
}
|