Artifact b76f813f67303957301646b08bf663d9305593a8fae1b0902b88fa2f28857887:
- File internal/api/opsdisk_unix.go — part of check-in [9c6501e68d] at 2026-10-24 03:35:26 on branch ops-findings — ops.status: findings as one rule set with first-seen, an hour of signals, stores and indexes, disk, dependencies, version and uptime (user: dmestas, size: 488) [annotate] [blame] [check-ins using] [more...]
//go:build unix package api import "syscall" // statfs is the filesystem under dir: its size and what an unprivileged // writer may still use, in bytes. ok is false when the path cannot be // measured, which is not a finding, only an absence. func statfs(dir string) (total, free uint64, ok bool) { var st syscall.Statfs_t if err := syscall.Statfs(dir, &st); err != nil { return 0, 0, false } bs := uint64(st.Bsize) return uint64(st.Blocks) * bs, uint64(st.Bavail) * bs, true }