vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
|
215f8aeb
Keenan Nemetz
2d ago
|
1 | //go:build unix |
| 2 | ||
| 3 | package agent | |
| 4 | ||
| 5 | import "syscall" | |
| 6 | ||
| 7 | // freeBytes reports how many bytes are available to this user on the filesystem | |
| 8 | // holding dir. | |
| 9 | func freeBytes(dir string) (int64, error) { | |
| 10 | var st syscall.Statfs_t | |
| 11 | if err := syscall.Statfs(dir, &st); err != nil { | |
| 12 | return 0, err | |
| 13 | } | |
| 14 | // Bsize is int64 on Linux and uint32 on Darwin, so it is converted here | |
| 15 | // rather than used directly. | |
| 16 | return int64(st.Bavail) * int64(st.Bsize), nil | |
| 17 | } |