Initial commit

This commit is contained in:
2026-09-12 23:26:07 +02:00
commit a180fe4b52
35 changed files with 4921 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
//go:build unix
package server
import "syscall"
// freeBytes reports the space available to an unprivileged writer on the
// filesystem holding path.
func freeBytes(path string) (int64, bool) {
var st syscall.Statfs_t
if err := syscall.Statfs(path, &st); err != nil {
return 0, false
}
return int64(st.Bavail) * int64(st.Bsize), true
}